Extracting a string that is separated by commas
Posted on 2003-11-27
I have this string that contain items, and each item is separated by a comma.
software, hardware, mouse, keyboard, etc.
What I want to do is to extract each of those words out and assign it to another variable, so that the new variable will end up storing: software,hardware,mouse,keyboard,etc.
I know I'm suppose to use the instr() and mid() but I'm stuck on the looping part, like going through the whole string and extracting it.
My main purpose for this is to put that new variable that stores the string without the space after the commas into a hidden text box, so mainly I'm extracting the words from the string is to take out the spaces. Am I going through the right approach or there's another way of doing this?
Thank you in advance.