Description

Gets characters from a string_,_ from the beginning and stops when it encounters any character that is not in a specified set of characters. The search is case sensitive. For example, SpanIncluding("mystring", "mystery") returns "mystr". Because, in the string "mystring", after "mystr", the character 'i' (which is not present in the second string "mystery") is encountered.

Returns

A string; characters from string, from the beginning to a character that is not in set.

Category

String functions

Function syntax

SpanIncluding(string, set)

See also

GetTokenSpanExcludingCaching parts of ColdFusion pages in Optimizing ColdFusion applications in the Developing ColdFusion Applications

Parameters

Parameter

Description

string

A string or a variable that contains the search string.

set

A string or a variable that contains a set of characters. Must contain one or more characters.

Example

<cfscript>
    string="Highway star"
    strToset="High"
    writeOutput(SpanIncluding(string,strToset)) // High
</cfscript>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy