How to Replace Sub string in String

  By Rizwan Saqib   Posted on March-28-2018   635

MS Sql Server

The REPLACE() function replaces all occurrences of a specified string.

Note: The REPLACE() function performs a case-sensitive replacement.

 For Example we have a string [First Name] we want to change in [Last   Name ] means Replace first into last

SELECT Replace ('FirstName','First','Last') AS ReplaceValue

it Give us Result like this

ReplaceValue

Last Name

 

The REPLACE() function replaces all occurrences of a specified string.

Note: The REPLACE() function performs a case-sensitive replacement.

 For Example we have a string [First Name] we want to change in [Last   Name ] means Replace first into last

SELECT Replace ('FirstName','First','Last') AS ReplaceValue

it Give us Result like this

ReplaceValue

Last Name

 

By  Rizwansaqib966    28-Mar-2018 Views  635



You may also read following recent Post