CutString8

Cuts a string from certain character to certain character with option of either or.
Like CutString, except it will search for either CutFrom or CutFromOR, then search until ToString or ToStringOR whichever found.


Public

Tested

My Own Work
Function CutString8(FromString, CutFrom, CutFromOR, ToString, ToStringOR, StartFromChar)
    ' Cuts a string from a string starting from a specific character and until a specific character
    ' With either/or functionality to search for two CutFrom and two ToString
    CutString8 = ""
    StartFromChar = 1
    If CutFrom > "" Then
        If InStr(StartFromChar, FromString, CutFrom) > 0 Then
            StartFromChar = InStr(StartFromChar, FromString, CutFrom) + Len(CutFrom)
        ElseIf InStr(StartFromChar, FromString, CutFromOR) > 0 Then
            StartFromChar = InStr(StartFromChar, FromString, CutFromOR) + Len(CutFromOR)
        End If
    End If
    CutString8 = Mid(FromString, StartFromChar)
    If ToString > "" Then
        End1 = Len(FromString)
        If InStr(StartFromChar, FromString, ToString) > 0 Then
                End1 = InStr(StartFromChar, FromString, ToString) - StartFromChar
        ElseIf InStr(StartFromChar, FromString, ToStringOR) > 0 Then
                End1 = InStr(StartFromChar, FromString, ToStringOR) - StartFromChar
        Else
        End If
        CutString8 = Mid(FromString, StartFromChar, End1)
    End If
End Function

FromString, CutFrom, CutFromOR, ToString, ToStringOR, StartFromChar

Views 118 Downloads 30

Classic ASP Texts + Strings
ANmarAmdeen
802
Attachments
Revisions

v1.0