Text Functions
The following section describes each availabe function for manipulting text strings, its associated syntax and examples of how to use each.
LEN
Returns you the length of a piece of text i.e. the number of characters. Note that spaces count.
Syntax | Where | Result |
---|---|---|
LEN(x) | x is text | A number |
Example | Result |
---|---|
=LEN("Mobile Forms") | 12 |
UPPER
Returns a string of text with all letters in upper-case.
Syntax | Where | Result |
---|---|---|
UPPER(x) | x is text | Text |
Example | Result |
---|---|
=UPPER("Mobile Forms") | "MOBILE FORMS" |
LOWER
Returns a string of text with all letters in lower-case.
Syntax | Where | Result |
---|---|---|
LOWER(x) | x is text | Text |
Example | Result |
---|---|
=LOWER("Mobile Forms") | "mobile forms" |
TRIM
Returns a string of text with all spaces at both the start and end of the text removed. Any spaces between words are preserved.
Syntax | Where | Result |
---|---|---|
TRIM(x) | x is text | Text |
Example | Result |
---|---|
=TRIM(" Mobile Forms ") | "Mobile Forms" |
REPT
Returns a text string composed of the characyed x repeated n times.
Syntax | Where | Result |
---|---|---|
REPT(x, n) | x is text n is a number | Text |
Example | Result |
---|---|
=REPT("-", 4) | "----" |
SUBSTITUTE
Returns a string with all occurrences of y in x replaced with z.
Syntax | Where | Result |
---|---|---|
=SUBSTITUTE(x, y, z) | x is text y is text z is text | Text |
Example | Result |
---|---|
=SUBSTITUTE("loonie toon", "oo", "u") | "lunie tun" |
FIND
Returns a result which is the location of the first occurance of x in y, after the nth character, or zero if x does not appear in y. n is treated as 1 if it is less than 1 (the first character). The result is always zero if n is greater than the length of y, since x will never apper after the end.
Syntax | Where | Result |
---|---|---|
FIND(x, y, n) | x is text y is text n is a number | A number |
Example | Result |
---|---|
=FIND("oo", "loonie toon", 1) | 2 |
=FIND("oo", "loonie toon", 2) | 2 |
=FIND("oo", "loonie toon", 3) | 1 |
=FIND("oo", "loonie toon", 10) | 0 |
=FIND("u", "loonie toon", 1) | 0 |