Delimited Strings

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Supposing I have a string containing fields delimited by | (pipe) such as:

this|is|a|string|delimited|by|pipes

If I wanted to get the portion of the string between the 3rd and 4th pipe,
I would have to start at the beginning of the entire string and inspect each
character to see if it is a pipe. Once I found the 3rd pipe, I could begin
parsing the string until a 4th pipe is discovered.

Is there a simpler and more elegant way to do this? There must be...

Thanks,
Mark
 
But your way will be the fastest since you know what you are going for.

You can use:

String.Split(Seperator as char, count as integer) as string()

That does the same thing you do, and returns an array of strings

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top