String Functions

  1. Overview
  2. MYSQL
  3. String Functions

MySQL ASCII() Function

The ASCII() function in MySQL is used to retrieve the ASCII value of a specified character. ASCII values are numeric representations of characters based on the ASCII (American Stan ...

MySQL CHAR_LENGTH() Function

The CHAR_LENGTH() function in MySQL is used to determine the number of characters in a string. It is particularly useful when working with text data where the length of the string ...

MySQL CHARACTER_LENGTH() Function

The CHARACTER_LENGTH() function in MySQL is used to determine the number of characters in a given string. This function is identical to the CHAR_LENGTH() function and provides the ...

MySQL CONCAT() Function

The CONCAT() function in MySQL is used to concatenate (combine) two or more strings or expressions into a single string. It is a simple yet powerful function for handling string co ...

MySQL CONCAT_WS() Function

MySQL CONCAT_WS() Function The CONCAT_WS() function in MySQL is used to concatenate (combine) two or more strings or expressions into a single string, with a specified separator i ...

MySQL FIELD() Function

The FIELD() function in MySQL is used to determine the index position of a value within a specified list of values. It is useful for finding the position of an element in a list, a ...

MySQL FIND_IN_SET() Function

The FIND_IN_SET() function in MySQL is used to locate the position of a string within a list of strings separated by commas. It is a straightforward and useful function for working ...

MySQL FORMAT() Function

The FORMAT() function in MySQL is used to format numbers with commas as thousands separators and round them to a specified number of decimal places. It is helpful for displaying nu ...

MySQL INSERT() Function

The INSERT() function in MySQL is used to modify a string by inserting a substring (string2) at a specified position, replacing a certain number of characters. Syntax INSERT(st ...

MySQL INSTR() Function

The INSTR() function in MySQL is used to find the position of the first occurrence of a substring within a string. If the substring is found, the function returns the position of i ...

MySQL LCASE() Function

The LCASE() function in MySQL is used to convert all characters in a given string to lowercase. This function is synonymous with the LOWER() function. Syntax LCASE(text) Par ...

MySQL LEFT() Function

The LEFT() function in MySQL is used to extract a specified number of characters from the start (left) of a string. Syntax LEFT(string, number_of_chars) Parameters Pa ...

MySQL LENGTH() Function

The LENGTH() function in MySQL is used to determine the length of a string in bytes. Syntax LENGTH(string) Parameters Parameter Description string Required ...

MySQL LOCATE() Function

The LOCATE() function in MySQL is used to find the position of the first occurrence of a substring within a string. Syntax LOCATE(substring, string, start) Parameters ...

MySQL LOWER() Function

The LOWER() function in MySQL is used to convert a string to lowercase. Syntax LOWER(text) Parameters Parameter Description text Required. The string to co ...

MySQL LPAD() Function

The LPAD() function in MySQL is used to left-pad a string with another string, making the final string reach a specified length. Syntax LPAD(string, length, lpad_string) Par ...

MySQL LTRIM() Function

The LTRIM() function in MySQL is used to remove leading spaces (spaces at the beginning of a string) from a given string. Syntax LTRIM(string) Parameters Parameter D ...

MySQL MID() Function

The MID() function in MySQL is used to extract a substring from a given string, starting at a specified position and with a specified length. Syntax MID(string, start, length) ...

MySQL POSITION() Function

The POSITION() function in MySQL is used to search for a substring within a string and return the position of its first occurrence. Syntax POSITION(substring IN string) Para ...

MySQL SUBSTRING_INDEX() Function

The SUBSTRING_INDEX() function is used to extract a substring from a string before or after a specified number of occurrences of a delimiter. Syntax SUBSTRING_INDEX(string, ...

MySQL REPEAT() Function

The REPEAT() function in MySQL is used to repeat a string a specified number of times. Syntax REPEAT(string, number) Parameters Parameter Description string ...

MySQL REPLACE() Function

The REPLACE() function in MySQL is used to replace all occurrences of a substring within a string with a new substring. Syntax REPLACE(string, substring, new_string) Paramet ...

MySQL REVERSE() Function

The REVERSE() function in MySQL is used to reverse the characters of a string and return the reversed string. Syntax REVERSE(string) Parameters Parameter Description ...

MySQL RIGHT() Function

The RIGHT() function in MySQL is used to extract a specified number of characters from the right side of a string. Syntax RIGHT(string, number_of_chars) Parameters Pa ...

MySQL RPAD() Function

The RPAD() function in MySQL is used to right-pad a string with another string to make the total length of the resulting string equal to a specified length. Syntax RPAD(string, ...

MySQL RTRIM() Function

The RTRIM() function in MySQL is used to remove trailing spaces (spaces at the end) from a string. Syntax RTRIM(string) Parameters Parameter Description str ...

MySQL SPACE() Function

The SPACE() function in MySQL returns a string consisting of a specified number of space characters. Syntax SPACE(number) Parameters Parameter Description n ...

MySQL STRCMP() Function

The STRCMP() function in MySQL compares two strings and returns an integer indicating the result of the comparison. Syntax STRCMP(string1, string2) Parameters Paramet ...

MySQL SUBSTR() Function

The SUBSTR() function in MySQL extracts a substring from a string, starting at a specified position and optionally extracting a defined number of characters. Syntax SUBSTR(stri ...

MySQL SUBSTRING() Function

The SUBSTRING() function in MySQL extracts a substring from a string, starting at a specific position and optionally extracting a defined number of characters. Syntax SUBSTRING ...

MySQL TRIM() Function

The TRIM() function in MySQL is used to remove both leading and trailing spaces from a string. It is particularly useful for cleaning up strings that might have unwanted spaces at ...

MySQL UPPER() Function

The UPPER() function in MySQL is used to convert a string to uppercase. It is functionally equivalent to the UCASE() function. Syntax UPPER(text) Parameters Parameter ...

MySQL UCASE() Function

The UCASE() function in MySQL is used to convert a string to uppercase letters. It is equivalent to the UPPER() function. Syntax UCASE(text) Parameters Parameter ...