Solved

obtain specified string from string....

Posted on 2006-07-07
1
218 Views
Last Modified: 2010-04-23
Dim code as string

code = "HH1234/12"

I can obtain the string [12] by using the following code:
Dim second as string =  code.Substring(code.IndexOf("/") + 1)

but how do i return "HH1234" to String [first] ?

Please note that we're not able to use Microsoft.VisualBasic.Strings.Left(code, 6) since the code could be "HH999/12" or "HH55/12"
0
Comment
Question by:kengkit
1 Comment
 
LVL 34

Accepted Solution

by:
Sancler earned 20 total points
ID: 17062824
       Dim code As String = "HH1234/12"
        Dim first As String = code.Substring(0, code.IndexOf("/"))
        MsgBox(first)

Roger
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 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

15 Experts available now in Live!

Get 1:1 Help Now