Function String Searches Class

GetToken

Remove the first token from the argument and return the token. The tokens are separated by the string vTokenSep.

Signature (Visual Basic / VBA)

Public Function GetToken( _
      ByRef rValue As Variant _
    , ByVal vTokenSep As Variant _
    , Optional ByVal vCompare As Variant _
    ) As Variant

Code Example

    Assuming
       Dim S As String
       S = "First,Second,Third"
    for example
       GetToken(S, ",") = "First"
    leaves
       S = "Second,Third"

Parameters

Parameter Description
rValue The string containing the tokens of which the first is to be removed and returned. Function returns Null if rValue is Null or cannot be fixed up to a String.
vTokenSep The string which separates the tokens within string rValue. Function returns Null if vTokenSep is Null or cannot be fixed up to a String. If the token separator vTokenSep is an empty string, then the string rValue is considered to consist of a single token.
vCompare Specifies the type of comparison used to determine if the token separator string vTokenSep appears within the string rValue. vCompare defaults to Binary comparisons if it is missing or Null or cannot be fixed up to a number.