August 2003
Intermediate to advanced
1140 pages
68h 45m
English
GetToken
GetToken(string, index [, delimiters ])Returns the token from string occupying
the specified index position. An optional
set of delimiters may be specified. If no
delimiters are specified, ColdFusion uses
the default of spaces, tabs, and newline characters. If
index is greater than the total number of
tokens in string, GetToken(
) returns an empty string. GetToken( )
is similar in function to the ListGetAt( )
function but is more versatile because it uses multiple sets of
delimiters. Note that the
GetToken( ) function currently treats successive
instances of the same delimiter as a single delimiter.
Here’s an example of this function:
<cfset MyString="999-99-9999"> <cfoutput> <b>String:</b> #MyString# <p>GetToken(MyString, 3, "-"): #GetToken(MyString, 3, "-")# </cfoutput>