This tutorial explains how to use the MySQL TRIM function with syntax and examples.
The MySQL TRIM function removes all specified characters either from the beginning or the end of a string.
The syntax for the TRIM function in MySQL is:
Optional. Removes the trim_character from the front of string.
Optional. Removes the trim_character from the end of string.
Optional. Removes the trim_character from the front and end of string.
Optional. The character that will be removed from string. If this parameter is omitted, it will remove space characters from string.
The string to trim.
The TRIM function can be used in the following versions of MySQL:
Let's look at some MySQL TRIM function examples and explore how to use the TRIM function in MySQL.
For example: