Solved

VB.Net - String Parsing

Posted on 2013-01-08
2
249 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
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

832 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