Solved

obtain specified string from string....

Posted on 2006-07-07
1
222 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

685 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