Math Functions: Strings Calculator
Math Functions: Strings
List of text string functions. Many functions include links to more in-depth descriptions and examples. Note that strings cannot be solved in solving equations. Instead, create strings using direct computation only.
[https://.../t/help_variables_strings|Learn more about strings as variables.]
__These functions are only available in templates.__
Creating Strings
" "
To create a variable as a string, assign the variable to "" or a quoted string. See the [https://.../t/help_variables_string | String Variables] section for more details on creating date variables.
**Details**
- Strings begin and end with quote marks " "
- Quote marks can be used within strings if escaped with a back slant: \"
Substring
++substring("string"; start)++ : returns a portion of 'string' starting at index 'start' through the end of the string
++substring("string"; start; end)++ : returns a portion of 'string' starting at index 'start' through 'end' inclusive
__This function is only available in templates.__
** Details**
- The first character in a string is index 1
- 'start' or 'end' less than 1 or greater than the number of characters will return a 'Parameter out of range' calculation error
- 'end' less than 'start' swaps 'start' and 'end'
Trim
++trim("string")++
Returns 'string' with any leading or trailing whitespace removed.
__This function is only available in templates.__
**Example**
String Information
Length
++length("string")++
Returns the number of characters in 'string'.
__This function is only available in templates.__
Index Of
++indexof("substring"; "string")++
Returns the position of the first occurrence of 'substring' within 'string' starting at the beginning of 'string'.
++indexof("substring"; "string"; index)++
Returns the position of the first occurrence of 'substring' within 'string' where a search begins at 'index' within 'string'.
__This function is only available in templates.__
**Details**
- The first character in a string is index 1
- Returns 0 if 'substring' is not found in 'string'
- Searches are case insensitive
- 'index' less than 1 or greater than the number of characters in 'string' will return a 'Parameter out of range' error
String Math
Addition
++"string 1" + "string 2"++
Combines 'string 1' and 'string 2' into a single string.
__This function is only available in templates.__
**Example**
[https://.../t/e38bbbe2640ddf8feb7a|Currency Conversions]
Keywords
-------------
""
Substring
substring()
Length
length()
Index Of
indexof()
Addition
+