|
-
Aug 30th, 2000, 11:21 AM
#1
Thread Starter
New Member
what is a good way to split a string variable into
several other variables, or seperate lines by number of characters?
Thanks
[email protected]
In the near future the common person will think that Microsoft developed the first operating system, and invented the internet in collaboration with Al Gore.
-
Aug 30th, 2000, 11:27 AM
#2
_______
<?>
[code]
Split
Returns a zero-based, one-dimensional array containing a specified number of substrings.
Syntax
Split(expression[, delimiter[, count[, compare]]])
The Split syntax has these parts:
Part Description
expression Required. String expression containing substrings and delimiters. If expression is a zero-length string, Split returns an empty array, that is, an array with no elements and no data.
delimiter Optional. String character used to identify substring limits. If omitted, the space character (" ") is assumed to be the delimiter. If delimiter is a zero-length string, a single-element array containing the entire expression string is returned.
count Optional. Number of substrings to be returned; -1 indicates that all substrings are returned.
compare Optional. Numeric value indicating the kind of comparison to use when evaluating substrings. See Settings section for values.
Settings
The compare argument can have the following values:
Constant Value Description
vbBinaryCompare 0 Perform a binary comparison.
vbTextCompare 1 Perform a textual comparison.
vbDatabaseCompare 2 Perform a comparison based on information contained in the database where the comparison is to be performed.
[/ode]
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 30th, 2000, 11:41 AM
#3
Use the Split() function
Code:
Dim MyString As String
MyString = "One,Two,Three,Four,Five"
'Split whenever there is a comma
MyArray = Split(MyString, ",")
'Display each element
For I = LBound(MyArray) To UBound(MyArray)
Print MyArray(I)
Next I
-
Aug 30th, 2000, 11:45 AM
#4
Thread Starter
New Member
call me crazy
so if I had a variable [penguin] and
penguin = "even if the attacker cannnot read the contents of your encrypted messages, he may be able to infer at least some useful information."
then I could
Split (penguin, Char(13), 25)
(trying to split it every 25 characters with a carriage return)
-
Aug 30th, 2000, 01:03 PM
#5
transcendental analytic
You would have to do it this way then:
Code:
dim n as integer,temp as string
For n=1 to len(penguin) step 25
if n>1 then temp=temp & vbcrlf
temp=temp & mid(penguin,n,25)
next n
penguin=temp
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|