ColdFusion 9.0 Resources |
SpanExcludingDescriptionGets characters from a string, from the beginning and stops when it encounters any of the characters in a specified set of characters. The search is case sensitive. For example, SpanExcluding("MyString", "inS") excludes "String" from "MyString" and returns "My". Because, in the string "MyString", after "My", the character 'S' (which is present in the second string "inS") is encountered. See alsoGetToken, SpanIncluding; Caching parts of ColdFusion pages in the Developing ColdFusion Applications Parameters
Example<h3>SpanExcluding Example</h3> <cfif IsDefined("FORM.myString")> <p>Your string was <cfoutput>#FORM.myString#</cfoutput> <p>Your set of characters was <cfoutput>#FORM.mySet#</cfoutput> <p>Your string up until one of the characters in the set is: <cfoutput>#SpanExcluding(FORM.myString, FORM.mySet)#</cfoutput> </cfif> <p>Returns all characters from string from beginning to a character from the set of characters. The search is case-sensitive. <form method = post action = "spanexcluding.cfm"> <p>Enter a string: <br><input type = "Text" name = "myString" value = "Hey, you!"> <p>And a set of characters: <br><input type = "Text" name = "mySet" value = "Ey"> <br><input type = "Submit" name = ""> </form> |