MySQL String Functions
23 functions
CONCATCONCAT(s1, s2, ...)Concatenates strings together.
CONCAT_WSCONCAT_WS(sep, s1, s2, ...)Concatenates strings with a separator between each.
SUBSTRINGSUBSTRING(str, pos, len)Extracts a substring from a specified position.
LEFTLEFT(str, n)Returns the leftmost n characters of a string.
RIGHTRIGHT(str, n)Returns the rightmost n characters of a string.
LENGTHLENGTH(str)Returns the byte length of a string.
CHAR_LENGTHCHAR_LENGTH(str)Returns the character count of a string.
UPPERUPPER(str)Converts a string to uppercase.
LOWERLOWER(str)Converts a string to lowercase.
TRIMTRIM([{BOTH|LEADING|TRAILING} remstr FROM] str)Removes leading and trailing spaces (or specified characters).
LTRIMLTRIM(str)Removes leading spaces from a string.
RTRIMRTRIM(str)Removes trailing spaces from a string.
REPLACEREPLACE(str, from, to)Replaces all occurrences of a substring.
INSTRINSTR(str, substr)Returns the position of the first occurrence of a substring.
LPADLPAD(str, len, padstr)Left-pads a string to a specified length with a given character.
RPADRPAD(str, len, padstr)Right-pads a string to a specified length with a given character.
REPEATREPEAT(str, n)Repeats a string n times.
REVERSEREVERSE(str)Reverses a string.
FORMATFORMAT(X, D)Formats a number as a string with thousands separators.
ASCIIASCII(str)Returns the ASCII code of the first character.
CHARCHAR(n, ...)Converts ASCII codes to characters.
HEXHEX(str | n)Converts a string or number to a hexadecimal string.
SPACESPACE(n)Returns a string of n spaces.
