• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Name

GetToken

Synopsis

                   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>

PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint