bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL TRIM() Function

Concept visual

MySQL TRIM() Function

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

Example

Remove leading and trailing spaces from a string:

SELECT TRIM('    SQL Tutorial    ') AS TrimmedString;

Definition and Usage

The TRIM() function removes leading and trailing spaces from a string.

Syntax

Trim(

string )

Parameter Values

Parameter

Description string

Required. The string to remove leading and trailing spaces from

Technical Details

Works in:

From MySQL 4.0

Previous

❮ MySQL Functions

Next

Previous

MySQL SUBSTRING_INDEX() Function

Next

MySQL UCASE() Function