Click to See Complete Forum and Search --> : ASP Split String


babygirl1213
03-03-2005, 11:52 AM
I NEED HELP!!!! I have created a form using some ASP script, one of the fields on the forms requires the user to copy text from another source. When it is copied into the text field, there are several spaces in the text (this is normal), However, once the form is submitted, I need to unstring this text field and separate the words in the string. HOW IS THIS DONE...i am new to using ASP, so let me know what info you need

phpnovice
03-03-2005, 12:25 PM
Try this on for size:

Do While InStr(str1, Space$(2)) > 0
str1 = Replace(str1, Space$(2), Space$(1))
Loop

babygirl1213
03-03-2005, 02:09 PM
I am not sure this is actually what i am looking for...here is an example:

The text field would be like this:

Smith 123455 1/23/2006 1/23/2006 abcdfeg

Once the form is submitted, I need to move each word to it's own field on the comma delimmeted text file that is created.

phpnovice
03-03-2005, 03:14 PM
Oh, OK, sory, I thought you just wanted to remove extra spaces. The following will split your string into an array using spaces as delimiters:

ary1 = Split(str1, Space$(1))

babygirl1213
03-04-2005, 07:45 AM
Thank you very much....!!!!

phpnovice
03-04-2005, 09:56 AM
Cheers.