×
☰ See All Chapters

MySQL LTRIM and RTRIM Function

MySQL LTRIM function removes whitespace from left side of a string.

MySQL RTRIM function removes whitespace from right side of a string.

MySQL LTRIM and RTRIM Function Syntax

LTRIM(arg)

RTRIM(arg)

arg is the argument that you want to trim whitespaces. This can be an expression or a direct value or a value from a column of any type.

MySQL LTRIM and RTRIM Function Example

SELECT FNAME, LNAME,LTRIM(FNAME),LTRIM(LNAME),RTRIM(FNAME),RTRIM(LNAME)

FROM NAME

mysql-ltrim-function-and-rtrim-function-0


All Chapters
Author