Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
This function will allow users to tokenize a strin...
Author:
Bhagyesh Trivedi
Submitted:
2/21/2003
Version:
VB5
Compatibility:
VB5, VB6
Category:
String Manipulation
Views:
13503
This function will allow users to tokenize a string. Takes a string as input and returns a string array of the token.
Declarations:
'none
Code:
Public Function tokenise(strToTokenise As String, strUsingWhat As String) As String() Dim i As Integer Dim j As Integer Dim mystr() As String Dim strLen As Integer strLen = Len(strToTokenise) If strLen > 0 Then ReDim Preserve mystr(0) End If i = 1 j = 0 While i <> 0 j = InStr(i, strToTokenise, strUsingWhat) If j <> 0 Then mystr(UBound(mystr)) = Mid(strToTokenise, i, j - i) i = j + 1 ReDim Preserve mystr(UBound(mystr) + 1) Else mystr(UBound(mystr)) = Mid(strToTokenise, i) i = j End If Wend tokenise = mystr End Function
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement