I am using this code to get string between two inputs but I would like to modify it
right now if you have something like this
Dim name as string = "my name is Paul Roman"
TextBox1.text = GetStringBetween(name, "name is " , "Roman")
that works perfectly fine and it extracts the name correctly
but for example lets say that I have about 30 lines
my name is Paul1 Roman1
my name is Paul2 Roman2
my name is Paul3 Roman3
my name is Paul4 Roman4
I would like to modify the code so that it finds in this example: "Paul3 Roman3"
and it extract the name "Paul3"
how can I do this to go in reverse like: input1 " Roman3" and imput2 "name is "
Function GetStringBetween(ByVal Str1 As String, ByVal str2 As String, ByVal str3 As String, Optional doReverse As Boolean = False) As String
Dim foundstr As String = ""
Dim i As Integer = Str1.ToUpper().IndexOf(str2.ToUpper())
Dim j As Integer
If i > -1 Then
Str1 = Str1.Substring(i + str2.Length)
j = Str1.ToUpper().IndexOf(str3.ToUpper())
If j > -1 Then
foundstr = Str1.Substring(0, j)