This is not an html plugin, it is a VB/VBA function that can not have preview here, to see it working, you need to add it to your VBA project and run the function

If you don't know what I am talking about, then this maybe not for you



' Cuts a string from single char to certain char
' Same as CutString but does the search from right to left
'
Function CutRightString(CutFrom, Optional FromChar = "", Optional ToChar = "")
' cut a string from a string FROM RIGHT starting from specific charactor and until a specific charactor
' FromChar is the char to cut from (not included)
' ToChar is the char to stop cut to (after FromChar is found) (not included)
' CurFrom is the string to cut from
' If FromChar is not given or not found, it will be assumed as 1
' If ToChar is not given or not found, it will be assumed as the length of the string
Dim Start1, End1
CutRightString = ""
Start1 = 0
If FromChar = "" Then GoTo Step2
For i = Len(CutFrom) To 1 Step -1
If UCase(Mid(CutFrom, i, 1)) = UCase(FromChar) Then
Start1 = i
Exit For
End If
Next i
Step2:
If Start1 = 0 Then Start1 = Len(CutFrom)
If ToChar = "" Then
CutRightString = Left(CutFrom, Start1 - 1)
Else
End1 = Start1 - 1
For i = End1 To 1 Step -1
If UCase(Mid(CutFrom, i, 1)) = UCase(ToChar) Then
End1 = i
Exit For
End If
Next i
If End1 = Start1 - 1 Then End1 = 1
If FromChar = "" And Start1 = Len(CutFrom) Then Start1 = Start1 + 1
CutRightString = Mid(CutFrom, End1 + 1, Start1 - End1 - 1)
End If
End Function