Hepen
asked on
Get data between a string?
How do I get data between a string?
"************<hello world>******************** *******"
how do i return hello world without the < and > ?
the easiest .net efficient way
the **** is symbolizing a random length.
"************<hello world>********************
how do i return hello world without the < and > ?
the easiest .net efficient way
the **** is symbolizing a random length.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Easier Regex pattern:
Dim pattern As String = "[\w\s]+"
Dim match As New Regex(input, pattern)
If match.Success Then
MessageBox.Show(match.Valu e)
End If
Bob
Dim pattern As String = "[\w\s]+"
Dim match As New Regex(input, pattern)
If match.Success Then
MessageBox.Show(match.Valu
End If
Bob
Hello, Hepen,
If you are sure that you have a "<" and at least one character prior to it, you could use:
strTest.Split("<"c, ">"c)(1)
where strTest contains your string.
Cheers,
Randy
If you are sure that you have a "<" and at least one character prior to it, you could use:
strTest.Split("<"c, ">"c)(1)
where strTest contains your string.
Cheers,
Randy
Dim regx As New System.Text.RegularExpress
Dim str As String = "************<hello to 24 the world>********************
With regx.Match(str)
MsgBox(regx.Replace(str, .Groups("TheString").Value
End With