Name
FindOneOf
Synopsis
FindOneOf(set, string
[,startpos
])
Returns the position of the first occurrence of any character from
set
in string
.
If no characters from set
are found,
FindOneOf( )
returns 0. An optional starting
position for the search can be specified by the
startpos
parameter. FindOneOf(
)
performs a case-sensitive search. Example:
<cfset MyString="This is a case-sensitive example of using the FindOneOf function to find a character from a set of charcters within a string."> <cfset MySet="zFx"> <cfoutput> <b>String:</b> #MyString#<br> <b>Set:</b> #MySet# <p>The first occurrence of any character from the set <b>#MySet#</b> is at position #FindOneOf(MySet, MyString)#. </cfoutput>
Get Programming ColdFusion MX, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.