Solved

VB.Net - String Parsing

Posted on 2013-01-08
2
244 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 500 total points
Comment Utility
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
Comment Utility
Excellent...I did not know to do it that way.  Very helpfull works great!

Thanks,
jimbo99999
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now