Function CutString3(InString, CutID, Optional Sepa = "||")
' In the Name of Allah
' Cut a specified string from a set of string seperated with a seperator
' Get the text with iRecord from sRecord based on its sequence in that text
Dim NewCut = InString & Sepa
Dim Part1 = InString
If CutID > 0 Then
Dim ThisID = 0
Dim LastSepa = 1
Dim FindSepa = InStr(LastSepa, NewCut, Sepa)
Do While FindSepa > 0
ThisID = ThisID + 1
If ThisID = CutID Then
Part1 = Mid(NewCut, LastSepa, FindSepa - LastSepa)
Exit Do
Else
LastSepa = FindSepa + Len(Sepa)
End If
FindSepa = InStr(LastSepa, NewCut, Sepa)
Loop
End If
CutString3 = Part1
End Function
' In the Name of Allah
' Cut a specified string from a set of string seperated with a seperator
' Get the text with iRecord from sRecord based on its sequence in that text
Dim NewCut = InString & Sepa
Dim Part1 = InString
If CutID > 0 Then
Dim ThisID = 0
Dim LastSepa = 1
Dim FindSepa = InStr(LastSepa, NewCut, Sepa)
Do While FindSepa > 0
ThisID = ThisID + 1
If ThisID = CutID Then
Part1 = Mid(NewCut, LastSepa, FindSepa - LastSepa)
Exit Do
Else
LastSepa = FindSepa + Len(Sepa)
End If
FindSepa = InStr(LastSepa, NewCut, Sepa)
Loop
End If
CutString3 = Part1
End Function
InString, CutID, Sepa
CutString3("Will you|read|my main|string?", 2, "|") will return read
Views 4,939
Downloads 1,495
CodeID
DB ID
ANmarAmdeen
610
Revisions
v2.0
Sunday
November
10
2019