Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Convert String to an Array

Keywords:   Convert String to an Array

Question:

Is there a way to take a one word string and break it into an array.

Example:

string = "string"
myarray = arrayize(string)

myarray[0] would equal s
myarray[1] would equal t
myarray[2] would equal r
myarray[3] would equal i
myarray[4] would equal n
myarray[5] would equal g 

Answer:

Try This:
myString = "string"
size = StrLen(myString)
strArray = ArrDimension(size)

For x = 0 to size-1
   strArray[x] = strSub(myString, x+1, 1)
Next

Article ID:   W14821