Answers for "vb.net getstringbetween"

VBA
1

vb.net getstringbetween

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 "VBA"

Browse Popular Code Answers by Language