LTRIM and RTRIM in SQL Server

TRIM function in SQL Server

TRIM function is used to removed the space of given strings.

Two types of TRIM function. i.e.

1.       RTRIM function
2.       LTRIM function

The RTRIM function is used to remove the right side space of given string.
The LTRIM function is used to remove the left side space of given string.

The query using  LTRIM and RTRIM as given below.

ALTER FUNCTION [dbo].[TRIM_STRING](@TEXT_STRING NVARCHAR(MAX))

RETURNS NVARCHAR(MAX)

BEGIN
     RETURN LTRIM(RTRIM(@TEXT_ STRING))
END




ANIL SINGH

Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
My Blogs - http://www.code-sample.com and http://www.code-sample.xyz
My Books - Google Amazon and Flipkart Book Store!

You Might Also Like
Post a Comment
www.code-sample.com/. Powered by Blogger.
ASK Questions
SQL Server NodeJs TypeScript JavaScript Angular SQL Server My Book