C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
MySQL Trim() FunctionThe trim() is a String function of MySQL. This function removes the blank spaces from the head and tail of the given string. SyntaxTRIM( [ LEADING | TRAILING | BOTH ] [ trim_character FROM ] string ) Parameter:str: string to be trimmed leading: it removes blank spaces from the front of string trainling: it removes blank spaces from the end of string both: it removes blank spaces from front and end of the string Example 1Select trim(' TheDeveloperBlog '); Output: Example 2Select trim(leading 'mysql' from 'mysql_TheDeveloperBlog '); Output: Example 3Select trim(both 'mysql' from 'mysql_TheDeveloperBlog_mysql'); Output: Example 4Select trim(trailing 'mysql' from 'TheDeveloperBlog_mysql'); Output:
Next TopicMySQL String
|