Söker fram delsträngar tex. LastSpanIncluding ("AB-122-23", "-") ger "AB-122"
'Function LastSpanIncluding(S, Sök)
'Plockar ut en delsträng fram till den sista
'sista förekomsten av ett givet tecken
Function LastSpanIncluding(S, Sök)
S = Reverse(S)
If Len(S) = 0 Or InStr(1, S, sSök) = 0 Then
LastSpanIncluding = Empty
Else
LastSpanIncluding = Reverse(Right$(S, Len(S) - InStr(1, S, sSök) + 1))
End If
End Function