String Functions :

The following scalar functions perform an operation on a string input value and return a string or numeric value. Note: Below functions which are having * are frequently used.
ASCIINCHARSOUNDEX
CHARPATINDEXSPACE
CHARINDEXQUOTENAMESTR
DIFFERENCEREPLACE*STUFF
LEFTREPLICATESUBSTRING
LEN*REVERSE*UNICODE
LOWER*RIGHTUPPER*
LTRIM*RTRIM*

Length:

Syntax: len ('string value') Ex: select len('palletechnologies') as 'op' Query to display employees in descending numbers of the total number of characters present in the employees fullname. -> select * from employees order by len(fname+lname) desc

Upper and Lower:

select upper(fname) as 'FNAME', upper(lname) as 'LNAME' from employees

Reverse:

select reverse 'palle' as 'revop' Query for displaying employees fullname in uppercase reverse format -> select upper(reverse) (fname+lname) as 'reverseupper fullname' from employees

Replace:

Syntax: replace(sourcestring, string to be replaced, replacing string)--->nvarchar Query to replace a letter from a word ->select replace('palle','a','z')

Substring:

By using this function we can extract portion of a string fron a given string. Syntax: substring(sourcestring,startposition,totallength)--->nvarchar Query for showing the result of substring operation on a word ->select substring 'palletechnologies',3,5) as 'res'

Ltrim, Rtrim:

used for removing left side and right side spaces respectively present in a given string. Ex: Select ltrim( 'palle technologies') as 'res' Query for displaying employee details whose fullname is having more than 10 characters. ->select * from employees where len(fname+lname>10) Query for displaying employee details whose fullname is having more characters ->select top 1 * from employees order by len(fname+lname) desc