Open In App

LTrim() and RTrim() Function in MS Access

Last Updated : 02 Sep, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

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

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads