String Functions
The following string functions are required for you to know in the specification, there of examples of how to use them below.
Function |
Use |
LOCATE(str1, str2) |
Return the start position of str2 in str1, -1 if str2 is not in str1 |
LEFT(str, n) |
Return the first n characters of str as a string |
MID(str, m, n) |
Return, as a string, the next n characters of str, starting at the mth character |
RIGHT(str, n) |
Return the last n characters of str |
LENGTH(str) |
Return the number of characters in str |
Examples
LOCATE("Technology", "chno") = 2
LOCATE("Technology", "Chno") = -1 (Note: C ≠ c)
LEFT("Technology", 6) = "Techno"
MID("Technology", 2, 4) = "chno"
RIGHT("Technology", 5) = "ology"
LENGTH("Technology") = 10