That's it for this section! Before we move on, let's review what we've learned:
|| is the concatenation operator. The
|| operator and the
CONCAT() function are the concatenation functions. Both merge multiple strings into one.
LENGTH(s) returns the length of a string.
UPPER() functions change all letters in a string to lowercase or uppercase.
INITCAP(t) changes the first letter of each word of string
t to title case.
TRIM(s) return a string after removing spaces from the left, right, or both sides of a given string
RTRIM(s, 'set'), and
TRIM(s, 'set') return a string after removing custom set of characters from the left, right, or both sides of a given string
SUBSTRING(s, x, y) returns part of string
s, starting from position
x and returning the number of characters defined by
LEFT(s, n) returns the first
n characters as the substring from the left side (beginning of the string).
RIGHT(s, n) returns the last
n characters as the substring from the right side (end of the string).
POSITION(c IN s) finds the first occurance (index) of string
c in string
STRPOS(s, c) does the same as the
POSITION() function but has a different syntax.
REVERSE() returns text with all the characters in reverse order.
REPLACE(string, from, to) will replace
to in the
TRANSLATE(string, from, to) will make replacements in
string based on the sets passed as strings into the
REPEAT(x, n) will return the
x string repeated
Now it's time to practice!