Sql server TRIM function | ASPMANTRA | Asp.Net,MVC,AngularJs,Jquery,Javascript,Sql Server AND WCF snippets and tutorial

Sql server TRIM function

In this article I am going to explain sql server TRIM function.


Description:
Trim function is used to remove blank spaces from string. You can use the RTRIM to remove the right side (end) blank space and LTRIM to remove left side (beginning) of string.

Syntax:
RTRIM ('character_expression')

LTRIM ('character_expression')

Example:
Truncate Right side:
select RTRIM('      Articlemirror      ') as 'Truncate Right side'

Truncate Left side:
select LTRIM('      Articlemirror      ') as 'Truncate Left side'

Truncate Left and right side:
select RTRIM(LTRIM('      Articlemirror      ')) as 'Truncate both side'

 Output:
Sql server TRIM function


Post a Comment

[blogger]

MKRdezign

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget