String Functions

namedescription
ascDetermines the value of a character.
binaryDecodeConverts a string to a binary object. Used to convert binary data that has been encoded into string format back into binary data.
binaryEncodeConverts binary data to a string.
charsetDecodeConverts a string to a binary representation.
charsetEncodeUses the specified encoding to convert binary data to a string.
chrConverts a numeric value to a UCS-2 character.
cJustifyCenters a string in a field length.
comparePerforms a case sensitive comparison of two strings.
compareNoCasePerforms a case-insensitive comparison of two strings.
dayOfWeekAsStringDetermines the day of the week, in a date, as a string function.
decryptDecrypts a string that is encrypted using a standard encryption technique, including strings encrypted by the Encrypt function.
decryptBinaryDecrypts encrypted binary data with the specified key, value, algorithm, salt, and iterations.
encryptEncrypts a string using a specific algorithm and encoding method.
encryptBinaryEncrypts binary data using a specific algorithm and encoding method.
findFinds the first occurrence of a substring in a string, from a specified start position. The search is case sensitive.
findNoCaseFinds the first occurrence of a substring in a string, from a specified start position. If substring is not in string, returns zero. The search is case-insensitive.
findOneOfFinds the first occurrence of any one of a set of characters in a string, from a specified start position. The search is case sensitive.
formatBaseNConverts number to a string, in the base specified by radix.
generateSecretKeyGets a secure key value for use in the Encrypt function.
getTokenDetermines whether a token of the list in the delimiters parameter is present in a string.
hashConverts a variable-length string to a fixed-length string that can act as a “fingerprint” or unique identifier for the original string. It is not possible to convert the hash result back to the source string.
insertInserts a substring in a string after a specified character position. If position=0, prefixes the substring to the string.
javaCastConverts the data type of a ColdFusion variable to a specified Java type to pass as an argument to Java or .NET object. Use only for scalar, string, and array arguments.
jSStringFormatEscapes special JavaScript characters, such as single-quotation mark, double-quotation mark, and newline.
lCaseConverts the alphabetic characters in a string to lowercase.
leftReturns the leftmost count characters in a string.
lenDetermines the length of a string or binary object.
listValueCountCounts instances of a specified value in a list. The search is case sensitive.
lJustifyLeft justifies characters in a string of a specified length.
lSIsNumericDetermines whether a string is a valid representation of a number in the current locale.
lSParseCurrencyConverts a locale-specific currency string into a formatted number. Attempts conversion by comparing the string with each the three supported currency formats (none, local, international) and using the first that matches.
lSParseDateTimeConverts a string that is a valid date/time representation in the current locale into a date/time object.
lSParseEuroCurrencyFormats a locale-specific currency string as a number. Attempts conversion through each of the default currency formats (none, local, international). Ensures correct handling of euro currency for Euro zone countries.
lSParseNumberConverts a string that is a valid numeric representation in the current locale into a formatted number.
lTrimRemoves leading spaces from a string.
midExtracts a substring from a string.
monthAsStringDetermines the name of the month that corresponds to month_number.
paragraphFormatReplaces characters in a string:
rEFindUses a regular expression (RE) to search a string for a pattern. The search is case sensitive.
rEFindNoCaseUses a regular expression (RE) to search a string for a pattern, starting from a specified position. The search is case-insensitive.
rEMatchUses a regular expression (RE) to search a string for a pattern, starting from a specified position. The search is case sensitive.
rEMatchNoCaseUses a regular expression (RE) to search a string for a pattern, starting from a specified position. The search is case-insensitive.
removeCharsRemoves characters from a string.
repeatStringCreates a string that contains a specified number of repetitions of the specified string.
replaceReplaces occurrences of substring1 in a string with substring2, in a specified scope. The search is case sensitive.
replaceListReplaces occurrences of the elements from a delimited list in a string with corresponding elements from another delimited list. The search is case sensitive.
replaceNoCaseReplaces occurrences of substring1 with substring2, in the specified scope. The search is case-insensitive.
rEReplaceUses a regular expression (RE) to search a string for a string pattern and replace it with another. The search is case sensitive.
rEReplaceNoCaseUses a regular expression to search a string for a string pattern and replace it with another. The search is case-insensitive.
reverseReverses the order of items, such as the characters in a string or the digits in a number.
rightGets a specified number of characters from a string, beginning at the right.
rJustifyRight justifies characters of a string.
rTrimRemoves spaces from the end of a string.
spanExcludingGets 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.
spanIncludingGets 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.
stripCRDeletes return characters from a string.
toBase64Calculates the Base64 representation of a string or binary object. The Base64 format uses printable characters, allowing binary data to be sent in forms and e-mail, and stored in a database or file.
toBinaryCalculates the binary representation of Base64-encoded data or of a PDF document.
toStringConverts a value to a string.
trimRemoves leading and trailing spaces and control characters from a string.
uCaseConverts the alphabetic characters in a string to uppercase.
uRLDecodeDecodes a URL-encoded string.
uRLEncodedFormatGenerates a URL-encoded string. For example, it replaces spaces with %20, and non-alphanumeric characters with equivalent hexadecimal escape sequences. Passes arbitrary strings within a URL (ColdFusion automatically decodes URL parameters that are passed to a page).
valConverts numeric characters that occur at the beginning of a string to a number.
wrapWraps text so that each line has a specified maximum number of characters.
xmlFormatEscapes special XML characters in a string so that the string can be used as text in XML.