Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 233
  • Last Modified:

obtain specified string from string....

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
kengkit
Asked:
kengkit
1 Solution
 
SanclerCommented:
       Dim code As String = "HH1234/12"
        Dim first As String = code.Substring(0, code.IndexOf("/"))
        MsgBox(first)

Roger
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now