Answers for "vb.net get string between"

VBA
1

vb.net get string between two strings

Public Function GetStringBetween(ByVal InputText As String, ByVal starttext As String, ByVal endtext As String)
  Dim startPos As Integer
  Dim endPos As Integer
  Dim lenStart As Integer
  startPos = InputText.IndexOf(starttext, StringComparison.CurrentCultureIgnoreCase)
  If startPos >= 0 Then
    lenStart = startPos + starttext.Length
    endPos = InputText.IndexOf(endtext, lenStart, StringComparison.CurrentCultureIgnoreCase)
    If endPos >= 0 Then
      Return InputText.Substring(lenStart, endPos - lenStart)
    End If
  End If
  Return "ERROR"
End Function
Posted by: Guest on December-04-2020

Code answers related to "vb.net get string between"

Code answers related to "VBA"

Browse Popular Code Answers by Language