VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

GetToken

Troy DeMonbreun  (1 Submission)   String Manipulation   Visual Basic 3.0   Unknown Difficulty   Wed 3rd February 2021

The following code is a Visual Basic function that returns a specific "token" (section/substring of data) from a delimited string list. The function accepts the index of the desired token and also the delimiter as specified by the programmer.

Inputs
Requires : [string] delimited data, [integer] index of desired section, [string] delimiter (1 or more chars)

Assumes
Examples: GetToken("[email protected]", 2, "@") returns "hotmail.com" GetToken("first,second,third", 2, ",") returns "second" GetToken("111, 222, 333", 3, ", ") returns "333" GetToken("line1" + vbCrLf + "line2" + vbCrLf + "line3", 2, vbCrLf) returns "line2"

Returns
Returns : [string] "Token" (section of data) from a list of delimited string data

API Declarations

Rate GetToken (5(5 Vote))
GetToken.bas

GetToken Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters