By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,097 Members | 1,351 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,097 IT Pros & Developers. It's quick & easy.

Parsing Strings_ Help me please in visual basic 2005

P: 9
Im not good at parsing strings....and Ive been driving myslef nuts

This is what I need to do....use an if/else statement to validate thata delimeter has been selected. These delimeters being comma, space and cr-lf.

Parse text box contents-----

Parse string to break out the words involving a loop and 2 pointer variable(old INdex and New INdex)Both start at 0..old index to always point to the current starting postion for the scan and extraction.New Index should be set to the position of the next delimeter. Inside the loop do these steps:

Scan the string from the starting position (old Index) Until a delimter is found. Set (new index) to the position of the delimeter using the index of method and assign the results to the (new index)

Extract the word from the starting position (Old Index) up tp but not including the delimeter position(New INdex) Use temp word to hold extracted word

Trim off spaces and load extracted word into the list box

Move the starting position(Old Index) forward past the extracted word and pass the delimeter

Words are apples, pears, oranges, bananas, cherries
Variables are

Delimeter-representing delimeter as String
Length as String
Temp String as String
TempWord as String
Advancesize as Integer

Comma, space = Advance size of 1
Cr-Lf =2

PLease please help I am so confused
Mar 25 '07 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 2,364
Hello, KellysGirl!

Please look in here:

If this does not work, stay tuned and keep asking questions.

Good luck!

Mar 25 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.