If we have to get rid of a particular suffix or prefix from string then the function TRIM is used. The thing which is very ordinary is known as white space. The way of calling this function in databases is not same.
• MySQL: TRIM(), RTRIM(), LTRIM()
• Oracle: RTRIM(), LTRIM()
• SQL Server: RTRIM(), LTRIM()
The basic structure for such type of functions is given below;
Here, the [LOCATION] can be used as TRAINLING or LEADING. We can use these two at the same time. From the start or ending point of string, we can remove the pattern [remstr]. If there is no such pattern then the white gaps are eliminated.
LTRIM(str): It eliminates all the white gaps which are used at the start of the string.
RTRIM(str): It eliminates all the white spaces which are used at the ending point of the given string.