MariaDB String Functions

This page lists the string functions in Mariadb that help you to manipulate strings efficiently.

  1. ASCII()

    In MariaDB, ASCII() is a built-in string function that returns the ASCII value of the first character of the specified string argument.
  2. BIN()

    In MariaDB, BIN() is a built-in string function that returns the string representation of the binary value of a given number.
  3. BIT_LENGTH()

    In MariaDB, BIT_LENGTH() is a built-in string function that returns the number of bits of the given string argument.
  4. CHAR_LENGTH()

    In MariaDB, CHAR_LENGTH() is a built-in string function that returns the number of characters for a given string argument.
  5. CHAR()

    In MariaDB, CHAR() is a built-in string function that converts each integer argument to the corresponding character and returns a string consisting of those characters.
  6. CHARACTER_LENGTH()

    In MariaDB, CHARACTER_LENGTH() is a built-in string function that returns the number of characters for a given string argument.
  7. CHR()

    In MariaDB, CHR() is a built-in string function, which converts the specified integer parameter into the corresponding character and returns it.
  8. COMPRESS()

    In MariaDB, COMPRESS() is a built-in function that compresses a string and returns the result as a binary string.
  9. CONCAT_WS()

    In MariaDB, CONCAT_WS() is a built-in string function that concatenates other string arguments using the specified delimiter and returns the result.
  10. CONCAT()

    In MariaDB, CONCAT() is a built-in string function that concatenates all argument lists and returns the result.
  11. ELT()

    In MariaDB, ELT() is a built-in string function that searches for the parameter at the position specified by the first parameter starting from the second parameter and returns it as a string.
  12. EXPORT_SET()

    In MariaDB, EXPORT_SET() is a built-in string function that generates a string using the specified delimiter based on the bits of the argument.
  13. FIELD()

    In MariaDB, the FIELD() function returns the position index of a specified value in a given list.
  14. FIND_IN_SET()

    In MariaDB, the FIND_IN_SET() function returns the index position where the given value occurs in the specified string list.
  15. FORMAT()

    In MariaDB, FORMAT() is a built-in string function that rounds a given number to a specified number of decimal places
  16. FROM_BASE64()

    In MariaDB, FROM_BASE64() is a built-in string function that decodes a given base-64 encoded string and returns the result as a binary string.
  17. HEX()

    In MariaDB, HEX() is a built-in string function that returns a hexadecimal string representation of its argument.
  18. INSERT()

    In MariaDB, INSERT() is a built-in string function that inserts a given string into another string at a specified position.
  19. INSTR()

    In MariaDB, the built-in string INSTR() function returns the index of the first occurrence of a substring within a string.
  20. LCASE()

    In MariaDB, LCASE() is a built-in string function that converts the given string parameter to lowercase and returns it.
  21. LEFT()

    In MariaDB, the LEFT() function extracts a given number of characters from the leftmost side of a string and returns them as a string.
  22. LENGTH()

    In MariaDB, LENGTH() is a built-in string function, it returns the length of the given string in bytes in default mode and returns the characters number of the string in Oracle mode.
  23. LENGTHB()

    In MariaDB, LENGTHB() is a built-in string function that returns the length of a given string in bytes.
  24. LOAD_FILE()

    In MariaDB, the LOAD_FILE() function reads a given file and returns the file contents as a string.
  25. LOCATE()

    In MariaDB, LOCATE() is a built-in string function that returns the index of the first occurrence of a substring within a string.
  26. LOWER()

    In MariaDB, LOWER() is a built-in string function that converts the given string parameter to lowercase and returns it.
  27. LPAD()

    The MariaDB LPAD() function left pads the given string to the specified length.
  28. LTRIM_ORACLE()

    In MariaDB, LTRIM_ORACLE() is a built-in string function that returns a string with all the leading whitespace removed.
  29. LTRIM()

    In MariaDB, LTRIM() is a built-in string function that returns a string with all the leading whitespaces removed.
  30. MAKE_SET()

    In MariaDB, MAKE_SET() is a string function that returns a comma-separated string collection,it determines whether other string parameters adds to the result collection by the binary value corresponding to the first parameter.
  31. MID()

    In MariaDB, MID() is a built-in string function that extracts a substring of a specified length from a string starting from a specified position.
  32. OCTET_LENGTH()

    In MariaDB, OCTET_LENGTH() is a built-in string function that returns the length in bytes of the given string argument.
  33. ORD()

    In MariaDB, ORD() is a built-in string function that returns the numeric code of the first character in a string argument.
  34. POSITION()

    In MariaDB, POSITION() is a built-in string function that returns the position of the first occurrence of a substring within a string.
  35. QUOTE()

    In MariaDB, QUOTE() is a built-in string function that returns a string enclosed in single quotes so that it is suitable for inclusion in an SQL statement.
  36. REGEXP_INSTR()

    In MariaDB, the REGEXP_INSTR() function searches a string for a substring that matches the specified pattern and returns the position index of the substring.
  37. REGEXP_REPLACE()

    In MariaDB, the REGEXP_REPLACE() function replaces a substring matching the specified regular expression with the new content.
  38. REGEXP_SUBSTR()

    In MariaDB, the REGEXP_SUBSTR() function returns the substring matching the specified regular expression from a string.
  39. REPEAT()

    In MariaDB, REPEAT() is a built-in string function that repeats the specified string for the specified number of times and returns it.
  40. REPLACE()

    In MariaDB, REPLACE() is a built-in string function that will replace all occurrences of a substring in a string with a new substring.
  41. REVERSE()

    In MariaDB, REVERSE() is a built-in string function that reverses the given string and returns it.
  42. RIGHT()

    In MariaDB, the RIGHT() function extracts a given number of characters from the rightmost part of a string and returns it.
  43. RPAD()

    The MariaDB RPAD() function right pads the given string to the specified length.
  44. RTRIM_ORACLE()

    In MariaDB, RTRIM_ORACLE() is a built-in string function that returns a string with all the trailing whitespaces removed.
  45. RTRIM()

    In MariaDB, RTRIM() is a built-in string function that returns a string with all the trailing whitespaces removed.
  46. SOUNDEX()

    In MariaDB, SOUNDEX() is a built-in string function that returns a soundex string representing the pronunciation of a given string.
  47. SOUNDS LIKE

    In MariaDB, you can use SOUNDS LIKE to compare whether two words are pronounced the same.
  48. SPACE()

    In MariaDB, SPACE() is a built-in string function that returns a string consisting of a specified number of spaces.
  49. STRCMP()

    In MariaDB, STRCMP() is a built-in string function that compares two strings and returns 0, -1 or 1 as the result of the comparison.
  50. SUBSTR()

    In MariaDB, SUBSTR() is a built-in string function that returns a substring of a specified length from a string starting at a specified position.
  51. SUBSTRING_INDEX()

    In MariaDB, SUBSTRING_INDEX() is a built-in string function that returns the substring of the specified number of occurrences of the specified delimiter.
  52. SUBSTRING()

    In MariaDB, SUBSTRING() is a built-in string function that returns a substring of a specified length from a string starting at a specified position.
  53. TO_BASE64()

    In MariaDB, TO_BASE64() is a built-in string function that converts its string argument to its base-64 encoded form.
  54. TO_CHAR()

    In MariaDB, TO_CHAR() is a built-in string function that converts a given date/time value to a string in a given format.
  55. TRIM_ORACLE()

    In MariaDB, TRIM_ORACLE() is a built-in string function that removes the longest string consisting of specified characters from the beginning or end of a specified string.
  56. TRIM()

    In MariaDB, TRIM() is a built-in string function that removes the longest string consisting of specified characters from the beginning or end of a specified string.
  57. UCASE()

    In MariaDB, UCASE() is a built-in string function that converts the given string argument to uppercase and returns the result.
  58. UNCOMPRESS()

    In MariaDB, UNCOMPRESS() is a built-in function that decompresses strings compressed by the COMPRESS() function.
  59. UNCOMPRESSED_LENGTH()

    In MariaDB, UNCOMPRESSED_LENGTH() is a built-in function that returns the length in bytes of a string before being compressed by the COMPRESS() function.
  60. UNHEX()

    In MariaDB, UNHEX() is a built-in string function that converts a string representing a hexadecimal value to bytes and returns the corresponding binary string.
  61. UPPER()

    In MariaDB, UPPER() is a built-in string function that converts the given string argument to uppercase and returns the result.
  62. WEIGHT_STRING()

    In MariaDB, WEIGHT_STRING() is a built-in function that returns a binary string representing the comparison and sort weights of the input strings.