Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String to Array(without delimiter!)

Status
Not open for further replies.

jstar7

Programmer
Dec 17, 2002
61
GB
Ok I want to turn my string into an array but I dont think its possible using split() because there is no delimeter.

My string looks like "111222121112221111222....

Any ideas?
 
can't remember if this works:

myStr = "111222121112221111222"

strArr = split(myStr,"")


If not, then loop

myStr = "111222121112221111222"
dim strArr()
redim strArr(0)
for x = 1 to length(myStr)
redim preserve strArr(x)
strArr(x) = mid(myStr,x,1)
next -----------------------------------------------------------------
"The difference between 'involvement' and 'commitment' is like an eggs-and-ham breakfast: the chicken was 'involved' - the pig was 'committed'."
- unknown

mikewolf@tst-us.com
 
You probably need to get each character of your string and stick it into an array that is the same size of the length of your string.

Something like this:

For i = 1 to Len(str)
char = Left(str, 1)
array(i-1) = char
str = Right(str, Len(str) - i)
Next

Good luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top