WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Arrays
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

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
File Created: 2001:11:08:12:40:10
Last Updated: 2001:11:08:12:40:10