Solved

VB.Net - String Parsing

Posted on 2013-01-08
2
255 Views
Last Modified: 2013-01-08
Good Day Experts!

I have a unique string parsing requirement that I need to integrate into my code.
An example value is: ---POSSIBLE,4680,0000A178R7142D,CR,1,04/07/2012---xxxxxxxx

1)---POSSIBLE will always start string
2)I need to grab from ---POSSIBLE to the next occurrenc of ---
3)Then strip ---POSSIBLE, off the front and --- off the back

What are some of the methods I can use to achieve this?  

Thanks,
jimbo99999
0
Comment
Question by:Jimbo99999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 38755975
Try following

Dim str As String = "---POSSIBLE,4680,0000A178R7142D,CR,1,04/07/2012---xxxxxxxx"
Dim FirstIndex As Integer = str.IndexOf(",")
Dim NextIndex As Integer = str.IndexOf("---", FirstIndex)

Dim NewStr = str.SubString(FirstIndex + 1, NextIndex - FirstIndex)
0
 

Author Comment

by:Jimbo99999
ID: 38756029
Excellent...I did not know to do it that way.  Very helpfull works great!

Thanks,
jimbo99999
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question