CFML Functions

string Category functions

Function Name Description
Asc Returns the ascii value of the first character, or 0, if empty
BinaryDecode Returns the binary object represented by the encoded string
BinaryEncode Returns the binary object encoded as a string using the encoding method given
Charat Returns the ascii character, as a string, of the position indicated
Charsetdecode Returns the binary object represented by the encoded string
Charsetencode Returns the binary object encoded as a string using the encoding method given
Chr Returns the character represented by the ascii value
Cjustify Returns the given string justified to the center, padding out the words with spaces accordingly
Compare Performs a lexical comparison. If string1 is less than string2 then -1 returned. If string1 greater than string then 1 is return. 0 if equals
Comparenocase Performs a lexical comparison, ignoring the case. If string1 is less than string2 then -1 returned. If string1 greater than string then 1 is return. 0 if equals
Encodeforfilename Encodes the string to be used as a filename. Removes all characters except for A-Z, a-z, 0-9, _ - .
Encodeforhtmlattribute Encodes the string to be used inside an HTML tag attribute. Escapes quotes, and special characters.
Encodeforjavascript Encodes the string to be used inside Javascript. Escapes quotes, and special characters.
Find Looks for the given substring in the string, starting optionally at the index position
FindNocase Looks for the given substring in the string (case insensitive), starting optionally at the index position
FindOneof Looks for the given characters in the string, starting optionally at the index position
Fixeol Cleans up the EOL (End Of Line) separators for the given string, replacing where necessary
GetToken Returns the token at the given position
Html An advanced parsing and selection model to work with HTML blocks in a very JQuery like selector manner
HtmlCodeformat Wraps the given string inside of the HTML <pre> .. </pre> tags, escaping the string accordingly
HtmlEditformat Escapes the given HTML string, replacing &, <, >, and quotes. For use inside of the HTML form elements
HtmlGetprintabletext Returns all the printable text from the HTML, devoid of all HTML tags, but maintaining any blank lines
HtmlSourceformat Transforms the HTML text into a printable, indented source layout
HtmlTidy Runs the W3 Tidy utility against the passed in HTML, performing a series of cleanup and HTML repair routines
Insert Inserts the substring into the given string at the given position
Jsstringformat Returns the given string escaped to work within Javascript blocks safely
Lcase Returns the lower cased version of the string
Left Returns the given string trimmed to the size given from the left of the string
Len Returns the length of the given string, binary, struct or array object
Ljustify Returns the given string justified to the left, padding out the words with spaces accordingly
Ltrim Trims the whitespace from the left side of the string only, returning the new string
Mid Returns substring within the string from the start position for the number of characters
Paragraphformat Formats the carriage returns in a string to a HTML alternatives
Reescape Returns a string that that has been escaped and safe to use in RegEx patterns. The characters we escape are $, {, }, (, ), [, ], ^, ., *, +, ?, &, and \.
Refind Performs a case-sensitive regular expression match to the given string. If subexpression=true then it returns a structure (pos,len)
Refindnocase Performs a case-insensitive regular expression match to the given string. If subexpression=true then it returns a structure (pos,len)
Rematch Returns an array of strings of all the matches that the given regular expression found performing a case-sensitive match
Rematchnocase Returns an array of strings of all the matches that the given regular expression found performing a case-insensitive match
Removechars Removes the substring from the given string, at the position for the characters count
Repeatstring Returns a new string, made up of the string repeated the number of times specified
Replace Looks for the occurences of a given substring within a string, replacing it with a new one
ReplaceList Peforms a series of search'n'replace on a single string using the comma-separated lists passed in
ReplaceNocase Looks for the occurences of a given substring within a string, replacing it with a new one, ignoring all case issues
Rereplace Runs a regular expression replacement against the string
Rereplacenocase Runs a regular expression replacement against the string
Reverse Returns the given string but in reverse order
Right Returns the given string trimmed to the size given from the right of the string
Rjustify Returns the given string justified to the right, padding out the words with spaces accordingly
Rtrim Trims the whitespace from the right side of the string only, returning the new string
SpanExcluding Returns back the string up to the point where any of the strings in sub-string is matched
SpanIncluding Returns back the string up to the point where any of the strings in sub-string is matched, including the substring
Stripcr Removes all carriage returns from a string
ToScript Used to convert the given input to Actionscript/Javascript variable
Trim Removes the whitespace from the front and back of the string
Ucase Returns the upper cased version of the string
Wrap Wraps the given string at the column width, optionally ignoring the any carriage returns from the original