Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB.Net - String Parsing

Posted on 2013-01-08
2
Medium Priority
?
265 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 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

721 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