MySQL LEFT() Function17 Mar 2025 | 1 min read LEFT(str,len) is a Sring function of MySQL. This method returns left side 'len' characters from the given string 'str'. SyntaxExample 1Output: ![]() Example 2Output: ![]() Next TopicMySQL String |
MySQL LPAD() Function LPAD(str,len,padstr) is a Sring function of MySQL. This method returns string 'str' which is left padded to the given length. Syntax select lpad(str, len, padstr) Example 1 Select lpad('java', 2, '**'); Output: Example 2 Select lpad('mysql', 3, '**'); Output: TopicMySQL String ...
1 min read
MySQL SUBSTRING_INDEX() Function The substring_index() is a String function of MySQL. This function returns a substring from the given string(str) before the counts come of the delimiter. Syntax select substring_index(str, delim, count); Parameter: str: main string delim: string to be searched count: number of times to search delim Returns: This function returns the substring of...
1 min read
MySQL QUOTE() Function Quote(str) is a Sring function of MySQL. This method returns the string which is passed in single quote. Syntax select quote(str); Example 1 select quote('javatpoint is a website'); Output: Example 2 select quote('mysql String function'); Output: TopicMySQL String ...
1 min read
MySQL REPLACE() Function REPLACE(str,from_str,to_str) is a Sring function of MySQL. This method returns string from the given string to the string. Syntax select replace(str, from_str, to_str); Example 1 select replace('java', 'javat', 'javatpoint'); Output: Example 2 select replace('MYSQL', 'sql', 'mysql'); Output: TopicMySQL String ...
1 min read
Function MySQL string functions manipulate the character string data effectively. The following table indicates each of the functions with a brief description: Functions Description CONCAT_WS() MySQL CONCAT_WS() function returns a string by concatenating arguments using separator. CONCAT() The CONCAT() function returns a string by concatenating all the arguments. CHARACTER_LENGTH() The CHARACTER_LENGTH() function returns the...
3 min read
MySQL Trim() Function The trim() is a String function of MySQL. This function removes the blank spaces from the head and tail of the given string. Syntax TRIM( [ LEADING | TRAILING | BOTH ] [ trim_character FROM ] string ) Parameter: str: string to be trimmed leading: it removes blank spaces...
1 min read
MySQL HEX(str), HEX(N) Function Hex() is a Sring function of MySQL. This method return in hexadecimal string of given number or String. Syntax select hex(S or N) Example 1 Select hex('a'); Output: Example 2 Select hex('b'); Output: Example 3 Select hex('c'); Output: TopicMySQL String ...
1 min read
MySQL LTRIM() Function LTRIM(str) is a Sring function of MySQL. This method returns string by removing leading space. Syntax select ltrim(str); Example 1 Select ltrim(' Javatpoint'); Output: Example 2 Select ltrim(' MySql '); Output: TopicMySQL String ...
1 min read
MySQL FIND_IN_SET() Function Find_in_set(str,strlist) is a Sring function of MySQL. This method return the value of the string which is given in first position in argument. Syntax select find_in_set(str, 'str1, str2,...'); Example 1 Select find_in_set('a','b,c,d,a'); Output: Example 2 Select find_in_set(4,'1,2,3,5,4,6'); Output: Example 3 Select find_in_set(12,'1,2,3,4,6'); Output: TopicMySQL String ...
1 min read
MySQL INSTR() Function INSTR(str,substr) is a Sring function of MySQL. This method return 1st occurrence of substring substr in string str. Syntax select instr(str,substr); Example 1 Select instr('Javanpoint',5,1,'t'); Output: Example 2 Select instr('MySql-Function',6,1,'String'); Output: TopicMySQL String ...
1 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India