On This Page

String Functions

Functions for text manipulation, searching, and formatting.

len

(text)

Returns the length, or number of characters, in a string.

Parameters
text string The string to measure
Returns number
Examples
len("Hello") 5
len("") 0

left

(text, count)

Returns the first N characters of a string.

Parameters
text string The source string
count number Number of characters to extract
Returns string
Examples
left("ProcessMind", 7) Process
See Also
(text, count)

Returns the last N characters of a string.

Parameters
text string The source string
count number Number of characters to extract
Returns string
Examples
right("ProcessMind", 4) Mind
See Also

mid

(text, start, count)

Returns a substring from the middle of a string, starting at a 1-based position and extracting a specified number of characters.

Parameters
text string The source string
start number Starting position (1-based)
count number Number of characters to extract
Returns string
Examples
mid("ProcessMind", 8, 4) Mind
mid("Hello World", 1, 5) Hello
See Also

lower

(text)

Converts a string to lowercase.

Parameters
text string The string to convert
Returns string
Examples
lower("HELLO") hello
See Also

upper

(text)

Converts a string to uppercase.

Parameters
text string The string to convert
Returns string
Examples
upper("hello") HELLO
See Also

proper

(text)

Converts a string to Proper Case by capitalizing the first letter of each word.

Parameters
text string The string to convert
Returns string
Examples
proper("hello world") Hello World
proper("HELLO WORLD") Hello World
See Also

trim

(text)

Removes whitespace from both ends of a string.

Parameters
text string The string to trim
Returns string
Examples
trim(" hello ") hello
See Also

trimStart

(text)

Removes whitespace from the beginning of a string.

Parameters
text string The string to trim
Returns string
Examples
trimStart(" hello") hello
See Also

trimEnd

(text)

Removes whitespace from the end of a string.

Parameters
text string The string to trim
Returns string
Examples
trimEnd("hello ") hello
See Also

replace

(text, search, replacement)

Replaces every occurrence of a search string with a replacement string.

Parameters
text string The source string
search string The string to find
replacement string The replacement string
Returns string
Examples
replace("Hello World", "World", "ProcessMind") Hello ProcessMind
replace("a-b-c", "-", "_") a_b_c

concat

(text1, text2, ...?)

Concatenates two or more strings.

Parameters
text1 string First string
text2 string Second string
... (optional) string Additional strings, up to 6 total
Returns string
Examples
concat("Hello", " ", "World") Hello World
Notes

You can also use the + operator for string concatenation.

contains

(text, search)

Checks whether a string contains another string.

Parameters
text string The string to search
search string The string to find
Returns boolean
Examples
contains("ProcessMind", "Mind") true
contains("Hello", "xyz") false
See Also

startsWith

(text, prefix)

Checks whether a string starts with a specified prefix.

Parameters
text string The string to check
prefix string The prefix to find
Returns boolean
Examples
startsWith("ProcessMind", "Process") true
See Also

endsWith

(text, suffix)

Checks whether a string ends with a specified suffix.

Parameters
text string The string to check
suffix string The suffix to find
Returns boolean
Examples
endsWith("ProcessMind", "Mind") true
See Also

indexOf

(text, search)

Returns the 1-based position of the first substring occurrence, or 0 if it is not found.

Parameters
text string The string to search
search string The string to find
Returns number
Examples
indexOf("ProcessMind", "Mind") 8
indexOf("Hello", "xyz") 0
See Also

find

(search, text)

Alias for indexOf. Returns the 1-based position of the first substring occurrence.

Parameters
search string The string to find
text string The string to search
Returns number
Examples
find("Mind", "ProcessMind") 8
Notes

Note the parameter order is reversed compared to indexOf.

See Also

padLeft

(text, length, char?)

Pads a string on the left to a specified length.

Parameters
text string The string to pad
length number The target length
char (optional) string The character to use for padding (default: " " (space))
Returns string
Examples
padLeft("42", 5, "0") 00042
padLeft("Hi", 5) Hi
See Also

padRight

(text, length, char?)

Pads a string on the right to a specified length.

Parameters
text string The string to pad
length number The target length
char (optional) string The character to use for padding (default: " " (space))
Returns string
Examples
padRight("Hi", 5, ".") Hi...
See Also