Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have a randomly generated string which is generated at runtime.

I want to capture the value of that string into an array such that

  • the first word of the string becomes the first element in the array,
  • second word the second element

    and so on.

Please help

share|improve this question
add comment (requires an account with 50 reputation)

1 Answer

up vote 1 down vote accepted

In VBscript use the Split function:

dim myArray, myString
myString = "This is an example"
myArray = Split(myString)
share|improve this answer
This My array would be the name of the array..Rite? dim rndstr() rndstr=split(string) It shows type mismatch error.. – Coder1010 Oct 29 '12 at 4:11
Remove the parenthesis: dim rndstr rndstr=split(string) Updating my answer to give a complete example. – Daniel Cook Oct 29 '12 at 4:48
Thanks Buddy,it worked :) – Coder1010 Oct 29 '12 at 4:52
add comment (requires an account with 50 reputation)

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.