Upper function change the output into upper case.
Lower function change the output into lower case.
Ltrim removes the leading blanks. The data are left aligned.
Rtrim removes the trailing characters. It truncate all trailing blanks.
Left function retrieve the first few characters from the left of the given string.
Right function retrieve the portion of the string counting from the right.
select UPPER('dotnet') as Upper, LOWER('DOTNET') as Lower, RTRIM('Ram ')+'Gopal' as Rtrim,
LTRIM(' Trichy') as Ltrim, LEFT('RamGopal',3) as Left, RIGHT('RamGopal',5) as Right
Upper Lower Rtrim Ltrim Left Right
DOTNET dotnet RamGopal Trichy Ram Gopal
It returns the ASCII code value of the leftmost character of a string.
It works just like ASCII, except it accepts the Unicode character value as input. This could be useful if you're working with international character sets.
Char function does the opposite of ASCII - it returns an alphanumeric equivalent of an ASCII code.
Nchar function works exactly like CHAR except it returns the Unicode character. This function is useful if you're working with large international character sets.
select ASCII('A') as ASCII, CHAR(65) as CHARACTER, UNICODE('1') as UNICODE, NCHAR(49) as NCHAR
ASCII CHARACTER UNICODE NCHAR
65 A 49 1
Reverse function gives you a mirror image of a given string.
This function replaces some characters within a string with another set of characters.
Len function finds the length of the character string.
Stuff function inserts a set of characters into a given string at a given position.
select REVERSE('DOTNET') as Reverse, REPLACE('122345',2,0) as Replace, LEN('DOTNET') as Length,
STUFF('AIJDEF',2,2,'BC') as Stuff
Reverse Replace Length Stuff
TENTOD 100345 6 ABCDEF