MACROMEDIA COLFUSION MX 7-CFML Reference page 642

Cfml reference
Hide thumbs Also See for COLFUSION MX 7-CFML:
Table of Contents

Advertisement

GetToken
Description
Determines whether a token of the list in the
Returns
The token found at position index of the string, as a string. If index is greater than the number of
tokens in the string, returns an empty string.
Category
String functions
Function syntax
GetToken(string, index [, delimiters ])
See also
,
,
Left
Right
Mid
Parameters
Parameter Description
string
A string or a variable that contains one. String in which to search.
index
Positive integer or a variable that contains one. The position of a token.
delimiters
A string or a variable that contains one. A delimited list of delimiters. Elements may
consist of multiple characters.
Default list of delimiters: space character, tab character, newline character; or their
codes: "chr(32)", "chr(9)", chr(10).
Default list delimiter: comma character.
Usage
The following examples show how this function works.
Example A: Consider the following code:
GetToken("red,blue:;red,black,tan:;red,pink,brown:;red,three", 2, ":;")
This function call requests element number 2 from the string, using the delimiter "
output is as follows:
red,black,tan
Example B: Consider the following code:
<cfset mystring = "four,"
& #chr(32)# & #chr(9)# & #chr(10)#
& ",five, nine,zero:;"
& #chr(10)#
& "nine,ten:, eleven:;twelve:;thirteen,"
& #chr(32)# & #chr(9)# & #chr(10)#
& ",four">
642
Chapter 3: ColdFusion Functions
,
,
SpanExcluding
SpanIncluding
parameter is present in a string.
delimiters
". The
:;

Advertisement

Table of Contents
loading

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents