Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB.Net - String Parsing

Posted on 2013-01-08
2
Medium Priority
?
271 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
2 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

886 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