Solved

obtain specified string from string....

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 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