LeighWardle
asked on
vb.net - How to determine string that follows a given substring
Hi Experts,
Is there a simple way to return "userfoldername", the string that follows "/USERFOLDER=" in this example?
"/USERFOLDER=userfoldernam e"
Regards,
Leigh
Is there a simple way to return "userfoldername", the string that follows "/USERFOLDER=" in this example?
"/USERFOLDER=userfoldernam
Regards,
Leigh
with substring function.
ASKER
Thanks, Ryan.
Would you mind combining the 2 parts, IndexOf function and substring function?
Regards,
Leigh
Would you mind combining the 2 parts, IndexOf function and substring function?
Regards,
Leigh
something like this...
Sub Main()
Dim test As String = "/USERFOLDER=userfoldername"
Dim idx As Integer = test.IndexOf("=")
Dim result As String = ""
If idx > -1 Then
result = test.Substring(idx+1, test.Length-idx-1)
End If
Console.WriteLine("Result = " + result)
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Is that ALL that is in the string?...or will that be mixed in with other values?
ASKER
Thanks, Ryan, your simple example works a treat!
Regards,
Leigh
Regards,
Leigh
http://www.dotnetperls.com/indexof-vbnet