Returns the specified token in a string. Default delimiters are spaces, tabs, and newline characters. If index is greater than the number of tokens in string, GetToken returns an empty string.
See also Left, Right, Mid, SpanExcluding, and SpanIncluding.
GetToken(string, index [, delimiters ])
Any string.
Any integer > 0 that indicates position of a token.
String containing sets of delimiters.
<!--- This example shows the use of GetToken ---> <HTML> <HEAD> <TITLE> GetToken Example </TITLE> </HEAD> <BODY BGCOLOR=silver> <H3>GetToken Example</H3> <CFIF IsDefined("FORM.yourString")> <!--- set delimiter ---> <CFIF FORM.yourDelimiter is not ""> <CFSET yourDelimiter = FORM.yourDelimiter> <CFELSE> <CFSET yourDelimiter = " "> </CFIF> <!--- check that number of elements in list is greater than or equal to the element sought to return ---> <CFIF ListLen(FORM.yourString, yourDelimiter) GTE FORM.returnElement> <CFOUTPUT> <P>Element #FORM.ReturnElement# in #FORM.yourString#, delimited by "#yourDelimiter#" <BR>is:#GetToken(FORM.yourString, FORM.returnElement, yourDelimiter)# </CFOUTPUT> ...