Sybase Forums,Unix Forums-Sybase Adaptive server|Replication Server|Sun Solaris Unix|Perl| Sybase Training

Full Version: ltrim and rtrim functions in sybase
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Using ltrim and rtrim functions in sybase

ltrim

Description

Returns the specified expression, trimmed of leading blanks.
Syntax

ltrim(char_expr | uchar_expr)

Parameters

char_expr

is a character-type column name, variable, or constant expression of char, varchar, nchar, or nvarchar type.

uchar_expr

is a character-type column name, variable, or constant expression of unichar or univarchar type.

Examples
Example 1

select ltrim(" 123")

-------
123

-------------------------------------------------------------------------------------------------------

rtrim

Description

Returns the specified expression, trimmed of trailing blanks.

Syntax

rtrim(char_expr | uchar_expr)

Parameters

char_expr

is a character-type column name, variable, or constant expression of char, varchar, nchar, or nvarchar type.

uchar_expr

is a character-type column name, variable, or constant expression of unichar or univarchar type.

Examples
Example 1

select rtrim("abcd ")

--------
abcd
Reference URL's