Advertisement
6_2008-2009 Coding Standards #213335

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

It simply tokenizes the string by a specified separator.

AI

สรุปโดย 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