GetTok How to tokenize a string ? (Like $gettok() in mIRC Scripting)
It simply tokenizes the string by a specified separator.
Assumes
Like $gettok identifier in mIRC. Easy to understand and use. Please vote for my code because this is my first code on planet-soruce-code.com :)
Rate GetTok How to tokenize a string ? (Like $gettok() in mIRC Scripting)
(3(3 Vote))
'Paste it into a module and call from anywhere!
Public Function GetTok(strString As String, N As Integer, strSep As String)
On Error Resume Next
Dim GArray
GArray = Split(strString, strSep)
If N = 0 Then
'if you specify 0 as N, then the function returns how much tokens exists in your string
GetTok = UBound(GArray) + 1
Exit Function
End If
GetTok = GArray(n - 1)
End Function
GetTok How to tokenize a string ? (Like $gettok() in mIRC Scripting) Comments
No comments yet — be the first to post one!
Post a Comment