string
String Methods
year(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
quarter(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
month(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
monthAsString(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
monthShortAsString(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
day(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
dayOfWeek(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
dayOfWeekAsString(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
dayOfWeekShortAsString(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
daysInMonth(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
daysInYear(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
dayOfYear(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
firstDayOfMonth(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
week(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
hour(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
minute(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
second(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
millisecond(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
nanosecond(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
offset(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
timezone(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
getnumericdate(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
getTime(timezone=[string], locale=[string])
Provides the BIF and member functions for all time unit request with no arguments
Arguments:
dateFormat(mask=[string], timezone=[string], locale=[string])
Formats a datetime, date or time
Arguments:
timeFormat(mask=[string], timezone=[string], locale=[string])
Formats a datetime, date or time
Arguments:
dateTimeFormat(mask=[string], timezone=[string], locale=[string])
Formats a datetime, date or time
Arguments:
parseDateTime(format=[string], timezone=[string], locale=[string])
Parses a datetime string or object
Arguments:
toDateTime(format=[string], timezone=[string], locale=[string])
Parses a datetime string or object
Arguments:
hash(algorithm=[string], encoding=[string], numIterations=[integer])
Creates an algorithmic hash of an object
Arguments:
hmac(key=[string], algorithm=[string], encoding=[string], numIterations=[integer])
Creates an algorithmic hash of an object
Arguments:
inputBaseN(radix=[integer])
Converts a string, using the base specified by radix, to an integer.
Arguments:
xMLFormat(escapeChars=[boolean])
Formats a string so that special XML characters can be used as text in XML
Arguments:
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. *
listSome(callback=[function:Predicate], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean], parallel=[boolean], maxThreads=[integer])
Tests whether any item in a list meets the specified callback
Arguments:
listReduceRight(callback=[function:BiFunction], initialValue=[any], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])
Run the provided udf over a reversed delimited list to reduce the values to a single output
Arguments:
listPrepend(value=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])
Filters a delimted list and returns the values from the callback test
Arguments:
listFirst(delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])
Returns the first or last item in a delimited list, according to the specified function name
Arguments:
listLast(delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])
Returns the first or last item in a delimited list, according to the specified function name
Arguments:
listIndexExists(index=[integer], delimiter=[string], includeEmptyFields=[boolean])
Checks if a list has a given index
Arguments:
listInsertAt(position=[integer], value=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])
Filters a delimted list and returns the values from the callback test
Arguments:
listChangeDelims(newDelimiter=[string], delimiter=[string], includeEmptyFields=[boolean])
Converts the delimiters of a list to the new delimiter.
Arguments:
listFind(value=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])
Return int position of value in delimited list, case sensitive or case-insenstive variations
Arguments:
listFindNoCase(value=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])
Return int position of value in delimited list, case sensitive or case-insenstive variations
Arguments:
listContains(value=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])
Return int position of value in delimited list, case sensitive or case-insenstive variations
Arguments:
listContainsNoCase(value=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])
Return int position of value in delimited list, case sensitive or case-insenstive variations
Arguments:
listCompact(delimiter=[string], multiCharacterDelimiter=[boolean])
Compacts a list by removing empty items from the start and end of the list
Arguments:
listTrim(delimiter=[string], multiCharacterDelimiter=[boolean])
Compacts a list by removing empty items from the start and end of the list
Arguments:
listMap(callback=[function:Function], delimiter=[string], includeEmptyFields=[boolean], parallel=[boolean], maxThreads=[integer])
Used to iterate over a delimited list and run the function closure for each item in the list and create a new list from the returned values.
Arguments:
listDeleteAt(position=[integer], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])
Deletes an element from a list.
Returns a copy of the list, without the specified element.
Arguments:
listRemoveDuplicates(delimiter=[string], ignoreCase=[boolean])
De-duplicates a delimited list - either case-sensitively or case-insenstively
Arguments:
listToArray(delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])
Converts a delimited list to an array
Arguments:
listQualify(qualifier=[string], delimiter=[string], elements=[string], includeEmptyFields=[boolean])
Inserts a string at the beginning and end of list elements.
Arguments:
listAppend(value=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])
Appends an element to a list
Arguments:
listValueCount(value=[string], delimiter=[string], includeEmptyFields=[boolean])
returns a count of the number of occurrences of a value in a list
Arguments:
listValueCountNoCase(value=[string], delimiter=[string], includeEmptyFields=[boolean])
returns a count of the number of occurrences of a value in a list
Arguments:
listAvg(delimiter=[string], multiCharacterDelimiter=[boolean])
Gets the average of all values in a list
Arguments:
listLen(delimiter=[string], includeEmptyFields=[boolean])
Calculates the length of a list separated by the specified delimiter
Arguments:
listRest(delimiter=[string], includeEmptyFields=[boolean], offset=[integer])
Returns the remainder of a list after removing the first item
Arguments:
listGetAt(position=[integer], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])
Retrieves an item from a delimited list at the specified position
Arguments:
listEvery(callback=[function:Predicate], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean], parallel=[boolean], maxThreads=[integer])
Tests whether all items in a list meet the specified callback
Arguments:
listEach(callback=[function:Consumer], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean], parallel=[boolean], maxThreads=[integer], ordered=[boolean])
Used to iterate over a delimited list and run the function closure for each item in the list.
Arguments:
listSort(sortType=[any], sortOrder=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean], localeSensitive=[boolean], callback=[any])
Sorts a delimited list and returns the result
Arguments:
listSetAt(position=[integer], value=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])
Retrieves an item in to a delimited list at the specified position
Arguments:
listFilter(filter=[function:Predicate], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean], parallel=[boolean], maxThreads=[integer])
Filters a delimted list and returns the values from the callback test
Arguments:
getToken(index=[integer], delimiter=[string])
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.
Arguments:
listItemTrim(delimiter=[string], includeEmptyFields=[boolean])
Trims each item in the list.
Arguments:
jSONDeserialize(strictMapping=[boolean], useCustomSerializer=[string])
Converts a JSON (JavaScript Object Notation) string data representation into data, such as a structure or array.
Arguments:
toBase64(encoding=[string])
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.
Arguments:
listToJSON(queryFormat=[string], useSecureJSONPrefix=[string], useCustomSerializer=[boolean])
Converts a BoxLang variable into a JSON (JavaScript Object Notation) string.
Arguments:
toJSON(queryFormat=[string], useSecureJSONPrefix=[string], useCustomSerializer=[boolean])
Converts a BoxLang variable into a JSON (JavaScript Object Notation) string.
Arguments:
isEmpty()
Determine whether a given value is empty.
We check for emptiness of anything that can be casted to: Array, Struct, Query, or String.
spanIncluding(set=[string])
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.
Arguments:
reFind(reg_expression=[string], start=[integer], returnSubExpressions=[boolean], scope=[string])
Uses a regular expression (RE) to search a string for a pattern, starting from a specified position.
The search is case-sensitive. It will return numeric if returnsubexpressions is false and a struct of arrays named "len", "match" and "pos" when returnsubexpressions is true.
Arguments:
reFindNoCase(reg_expression=[string], start=[integer], returnSubExpressions=[boolean], scope=[string])
Uses a regular expression (RE) to search a string for a pattern, starting from a specified position.
The search is case-sensitive. It will return numeric if returnsubexpressions is false and a struct of arrays named "len", "match" and "pos" when returnsubexpressions is true.
Arguments:
val()
Converts numeric characters and the first period found that occur at the beginning of a string to a number.
A period not accompianied by at least one numeric digit will be ignored. If no numeric digits are found at the start of the string, zero will be returned.
compare(string2=[any])
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
Arguments:
reReplace(regex=[string], substring=[string], scope=[string])
Uses a regular expression (regex) to search a string for a string pattern and replace it with another.
The search is case-sensitive.
Arguments:
reReplaceNoCase(regex=[string], substring=[string], scope=[string])
Uses a regular expression (regex) to search a string for a string pattern and replace it with another.
The search is case-sensitive.
Arguments:
insert(substring=[string], position=[integer])
Inserts a substring into another string at a specified position.
Arguments:
bind(placeholders=[structloose])
This BIF allows you to bind a string with placeholders to a set of values.
Each placeholder is defined as ,{@code ${placeholder-name}}, and can be used anywhere and multiple times in the string.
Arguments:
findOneOf(set=[string], start=[integer])
Finds the first occurrence of any character in a set of characters, from a specified start position.
Arguments:
spanExcluding(set=[string])
Get characters from a string, from the beginning to a character that is in a specified set of characters.
The search is case-sensitive.
Arguments:
compareNoCase(string2=[string])
Performs a case-insensitive 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
Arguments:
stringReduceRight(callback=[function:BiFunction], initialValue=[any], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])
Run the provided udf over a reversed string to reduce the values to a single output
Arguments:
replace(substring1=[string], obj=[any], scope=[string])
Replaces occurrences of substring1 in a string with obj, in a specified scope.
The search is case-sensitive. Function returns original string with replacements made
Arguments:
replaceList(list1=[string], list2=[string], delimiter_list1=[string], delimiter_list2=[string], includeEmptyFields=[boolean])
Replaces occurrences of the elements from a delimited list, in a string with corresponding elements from another delimited list.
Arguments:
replaceListNoCase(list1=[string], list2=[string], delimiter_list1=[string], delimiter_list2=[string], includeEmptyFields=[boolean])
Replaces occurrences of the elements from a delimited list, in a string with corresponding elements from another delimited list.
Arguments:
stringSort(sortType=[any], sortOrder=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean], localeSensitive=[boolean], callback=[any])
Sorts a string and returns the result
Arguments:
uCFirst(doAll=[boolean], doLowerIfAllUppercase=[boolean])
Transform the first letter of a string to uppercase or the first letter of each word, and optionally lowercase uppercase characters.
Arguments:
find(substring=[string], start=[integer])
Finds the first occurrence of a substring in a string, from a specified start position.
Arguments:
findNoCase(substring=[string], start=[integer])
Finds the first occurrence of a substring in a string, from a specified start position.
Arguments:
reMatch(reg_expression=[string])
Uses a regular expression (RE) to search a string for a pattern, starting from a specified position.
Arguments:
reMatchNoCase(reg_expression=[string])
Uses a regular expression (RE) to search a string for a pattern, starting from a specified position.
Arguments:
lJustify(length=[integer])
Justifies characters in a string of a specified length, either left or right.
Arguments:
rJustify(length=[integer])
Justifies characters in a string of a specified length, either left or right.
Arguments:
listReduce(callback=[function:BiFunction], initialValue=[any], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])
Run the provided udf over a delimited list to reduce the values to a single output
Arguments:
replaceNoCase(substring1=[string], obj=[any], scope=[string], start=[string])
Replaces occurrences of substring1 in a string with obj, in a specified scope.
The search is case-sensitive. Function returns original string with replacements made
Arguments:
jsFormat()
Escapes special JavaScript characters, such as single quotation mark, double quotation mark, and newline
stringSome(callback=[function:Predicate], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean], parallel=[boolean], maxThreads=[integer])
Tests whether any item in a string meets the specified callback
Arguments:
paragraphFormat()
Replaces characters in a string: Single newline characters (CR/LF sequences) with spaces and double newline characters with HTML paragraph tags
Examples
Last updated