Login     Register

        Contact Us     Search

XLeratorDB/strings Online Documentation

SQL Server TRIM function


TRIM

Updated: 31 July 2009


Use TRIM to remove trailing and leading spaces from a string of text.
Syntax
SELECT [wctString].[wct].[TRIM] (
   <@Text, nvarchar(max),>)
Arguments
@Text
is the text value to be evaluated. The @Text argument can be of data types that are implicitly convertible to nvarchar or ntext.
Return Types
nvarchar(max)
Remarks
·         TRIM(@Text) = RTRIM(LTRIM(@Text))
Examples
 
select '>>>+ wct.TRIM('  now is the time for all good men to come to the aid of their country  ') + '<<<'
 
This produces the following result
-------------------------------------------------------------------------------------------------
>>>now is the time for all good men to come to the aid of their country<<<
 

(1 row(s) affected)

 
See Also


Copyright 2008-2024 Westclintech LLC         Privacy Policy        Terms of Service