mevets
Member
I don't understand how this example is out of range:
To provide perspective the script is meant to take a string like "Gui, Add, Text, vhi ghi, Hello" and extract Hello out of it by looping the creation of a substring at the position of InStr(", ") and for the length of str.length - InStr(", ") .
Can anyone provide insight on this?
VB.NET:
Dim strText As String = "Gui, Add, Text, vhi ghi, Hello"
Dim intTextLen As Integer = strText.Length
Dim posDlmtr As integer
Dim i As Integer = 1
Dim canLoop As Boolean = True
Do While canLoop = True
intTextLen = strText.Length
posDlmtr = InStr(strText, ", ")
If posDlmtr > 0 Then
strText = strText.Substring(posDlmtr + 2, intTextLen - posDlmtr + 2)
ElseIf posDlmtr <= 0 Then
canLoop = False
End If
Loop
strText.Trim()
MsgBox(strText)
Can anyone provide insight on this?