LTrim() and RTrim() Function in MS Access

1. LTrim() Function :
In MS Access LTrim() function remove all the leading spaces from the given string. In LTrim() function a string will be pass as a parameter and it will return the string with no leading spaces.

Syntax :

LTrim(string)

Example-1 :

SELECT LTrim("    GEEKSFORGEEKS") AS LeftTrimmedString;

Output –

LeftTrimmedString
GEEKSFORGEEKS

Example-2 :



SELECT LTrim("    GFG") AS LeftTrimmedString;

Output –

LeftTrimmedString
GFG

2. RTrim() Function :
It works same like LTrim() function but it will remove all trailing spaces from a string.

Syntax :

RTrim(string)

Example-1 :

SELECT RTrim("GEEKSFORGEEKS    ") AS RightTrimmedString;

Output –

RightTrimmedString
GEEKSFORGEEKS

Example-2 :

SELECT RTrim("GFG    ") AS RightTrimmedString;

Output –

RightTrimmedString
GFG
My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.