LTrim() and RTrim() Function in MS Access
Last Updated :
02 Sep, 2020
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 –
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 –
Share your thoughts in the comments
Please Login to comment...