String
Object
string.asc() Determines the value of a character.
string.cJustify() Returns the given string justified to the center, padding out the words with spaces accordingly
string.compare() Performs a case-sensitive comparison of two strings.
-1, if string1 is less than string2
0, if string1 is equal to string2
1, if string1 is greater than string2
string.compareNoCase() Performs a case-insensitive comparison of two strings.
An indicator of the difference:
A negative number, if string1 is less than string2
0, if string1 is equal to string2
A positive number, if string1 is greater than string2
string.decodeForHTML() Decodes the given encoded string.
string.decodeFromURL() Decodes a string that has been encoded in the URL using the encodeForURL.
this function is deprecated, use function ESAPIDecode('url',...) instead.
string.deserializeJSON() Converts a JSON (JavaScript Object Notation) or JSON5 string data representation into CFML data, such as a struct or array.
string.each() Iterates over a string and runs the closure function for each element in the string.
string.encodeForCSS() Encodes the given string for safe output in CSS to reduce the risk of Cross Site Scripting attacks.
string.encodeForDN() Encodes the given string for safe output in LDAP Distinguished Names.
string.encodeForHTML() Encodes the given string for safe output in HTML to reduce the risk of Cross Site Scripting attacks.
string.encodeForHTMLAttribute() Encodes the given string for safe output in HTML to reduce the risk of Cross Site Scripting attacks.
string.encodeForJavascript() Encodes the given string for safe output in JavaScript to reduce the risk of Cross Site Scripting attacks.
string.encodeForLDAP() Encodes the given string for safe output in LDAP queries.
string.encodeForSQL() Encodes the given string for safe output in a query to reduce the risk of SQL Injection attacks. _This method is not recommended_ - the use of query parameters are strongly encouraged as a stronger alternative.
string.encodeForURL() Encodes the given string for safe output in a URL.
string.encodeForXML() Encodes the given string for safe output in XML to reduce the risk of Cross Site Scripting attacks.
string.encodeForXMLAttribute() Encodes the given string for safe output in XMLAttribute to reduce the risk of Cross Site Scripting attacks.
string.encodeForXPath() Encodes the given string for safe use in an XPath Query.
string.encrypt() Encrypts a string. Uses a symmetric key-based algorithm, in
which the same key is used to encrypt and decrypt a string.
The security of the encrypted string depends on maintaining
the secrecy of the key. Uses an XOR-based algorithm that uses
a pseudo-random 32-bit key, based on a seed passed by the user
as a function parameter.
string.every() Determines if all elements of a string satisfy a given condition.
string.filter() Filters a string to its elements for which the callback function returns true.
string.find() Finds the first occurrence of a substring in a string, from a
specified start position. The search is case-sensitive.
string.findLast() Finds the last occurrence of a substring in a string, from a
specified start position. The search is case-sensitive.
string.findLastNoCase() Finds the last 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.
string.findNoCase() Finds 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.
string.findOneOf() Finds the first occurrence of any one of a set of characters
in a string, from a specified start position. The search is
case-sensitive.
string.getToken() Determines whether a token of the list in the delimiters
parameter is present in a string.
Returns the token found at position index of the string, as a
string. If index is greater than the number of tokens in the
string, returns an empty string.
string.hash() Converts a variable-length string to a 32-byte, hexadecimal
string, using the MD5 algorithm. (It is not possible to convert
the hash result back to the source string.)
32-byte, hexadecimal string
string.insert() Inserts a substring in a string after a specified character
position. If position = 0, prefixes the substring to the
string.
string.lCase() Converts the alphabetic characters in a string to lowercase.
string.left() Returns a substring from beginning of the input string, with a length specified by the count argument.
string.len() returns the len of a string
string.listAppend() Concatenates a list or element to a list.
string.listChangeDelims() Changes a list delimiter.
Returns a copy of the list, with each delimiter character
replaced by new_delimiter.
string.listCompact() Removes any empty items from the start and end of the list
string.listContains() Determines the index of the first list element that contains a
specified substring.
Returns the index of the first list element that contains
substring. If not found, returns zero.
string.listContainsNoCase() Determines the index of the first list element that contains a
specified substring.
string.listDeleteAt() Deletes an element from a list.
Returns a copy of the list, without the specified element.
string.listEach() call the given UDF/Closure with every value in the string list.
string.listEvery() This function calls a given closure/function with every element in a given string list and returns true, if all of the closure calls returns true.
string.listFilter() This function creates a new string list that returns all entries from an string list that match the given filter.
string.listFind() Determines the index of the first list element in which a
specified value occurs. Case-sensitive
string.listFindNoCase() Determines the index of the first list element in which a
specified value occurs
string.listFirst() Gets the first element of a list.
string.listGetAt() Gets a list element at a specified position.
string.listIndexExists() Determines if an element at the given position exists or not
string.listInsertAt() Inserts an element in a list.
string.listItemTrim() Removes all the white space surrounding each element, returning back the new list
string.listLast() Gets the last element of a list.
string.ListLen() Determines the number of elements in a list.
string.listMap() Calls the given closure with every element in the given list.
The function returns a list that contains all values returned by the closure.
string.listPrepend() Inserts an element at the beginning of a list.
string.listQualifiedToArray() Copies the elements of a list to an array.
string.listQualify() Inserts a string at the beginning and end of list elements.
string.listReduce() Iterates over every entry of the given list and calls the closure with every element.
This function will reduce the list to a single value and will return the value.
string.listRemoveDuplicates() Removes duplicate values from list.
string.listRest() Gets a list, without its first element.
string.listSetAt() Replaces the contents of a list element.
string.listSome() This function calls a given closure/function with every element in a given string list and returns true, if one of the closure calls returns true.
string.listSort() Sorts list elements according to a sort type and sort order.
string.listToArray() Copies the elements of a list to an array.
string.listValueCount() Counts instances of a specified value in a list. The search is
case-sensitive.
string.listValueCountNoCase() Counts instances of a specified value in a list. The search is
case-insensitive.
string.lJustify() Left justifies characters in a string of a specified length.
string.ltrim() Removes leading spaces from a string.
string.map() Iterates over every entry of the string and calls the closure function to work on the element of the string.
string.MarkdownToHTML() Transforms Markdown formatted String into HTML.
string.mid() Extracts a substring from a string.
string.paragraphFormat() Formats the carriage returns in a string to a HTML alternatives
string.parseDateTime() Parses a date/time string according to the English (U.S.) locale conventions.
string.reduce() Iterates over every element of the string and calls the closure to work on the elements of the string. This function will reduce the string to a single value and will return the value.
string.reFind() Uses a regular expression (RE) to search a string for a pattern. The search is case sensitive.
string.reFindNoCase() Uses a regular expression (RE) to search a string for a pattern,
starting from a specified position. The search is
case-insensitive.
string.REMatch() Uses a regular expression (RE) to search a string for a pattern, starting from a specified position.
string.REMatchNoCase() Uses a regular expression (RE) to search a string for a pattern, starting from a specified position.
string.removeChars() Removes characters from a string.
string.repeatString() Creates a string that contains a specified number of
repetitions of the specified string.
string.replace() Replaces occurrences of substring1 in a string with substring2,
in a specified scope. The search is case-sensitive.
string.replaceList() Replaces occurrences of the elements from a delimited list
in a string with corresponding elements from another delimited
list. The search is case-sensitive.
string.replaceListNoCase() Replaces occurrences of the elements from a delimited list
in a string with corresponding elements from another delimited
list. The search is NOT case-sensitive.
string.replaceNoCase() Replaces occurrences of substring1 with substring2, in the
specified scope. The search is case-insensitive.
string.rEReplace() Uses a regular expression (RE) to search a string for a string
pattern and replace it with another. The search is
case-sensitive.
string.rEReplaceNoCase() Uses a regular expression to search a string for a string
pattern and replace it with another. The search is
case-insensitive.
string.reverse() Reverses the order of items, such as the characters in a
string, the digits in a number, or the elements in an array.
string.right() Returns a substring from end of the input string, with a length specified by the count argument.
string.rJustify() Right justifies characters of a string.
string.rtrim() Removes spaces from the end of a string.
string.sanitizeHTML() Sanitizes unsafe HTML input and removes elements and attributes like JavaScript, onclick, etc.
See also https://github.com/OWASP/java-html-sanitizer
string.some() This function calls a given closure/function with every element in a given string and returns true, if one of the closure calls returns true.
string.sort() Returns a string containing the sorted characters from the input.
string.spanExcluding() Gets characters from a string, from the beginning to a
character that is in a specified set of characters. The
search is case-sensitive.
string.spanIncluding() Gets characters from a string, from the beginning to a
character that is not in a specified set of characters. The
search is case-sensitive.
string.stripCr() Deletes return characters from a string.
string.toBase64() Calculates 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.
string.trim() Removes leading and trailing spaces from a string.
string.trimWhiteSpace() clean white space of the given string
string.uCase() Converts the alphabetic characters in a string to uppercase.
string.ucFirst() Capitalizes the first character of the given string.
string.uRLDecode() Decodes a URL-encoded string.
string.URLEncode() Encodes a string to be URL-safe according to the application/x-www-form-urlencoded MIME format
string.uRLEncodedFormat() Generates 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.
string.wrap() Wraps text so that each line has a specified maximum number of characters.