Advertisement
Java_Volume1 Coding Standards #88191

GetTok - How to tokenize a string ? (Like $gettok() in mIRC Scripting)

It simply tokenizes the string by a specified separator.

AI

एआई सारांश: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

सोर्स कोड
original-source
'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
मूल टिप्पणियाँ (3)
Wayback Machine से पुनर्प्राप्त