What is difference between STUFF and REPLACE?


STUFF: – This function is used to replace string expression from the given start position, char length to replace with the given string replacement.

Syntax:-

STUFF ( string_expression , startPosition , length , string_replacement )

For example:-

 Select Stuff ('Application', 8, 4, 'ble')


Result:- Applicable

REPLACE : – This function is used to replace all occurrences of a string pattern with the string replacement.

Syntax:-

REPLACE ( string_expression , string_pattern , string_replacement )

For example:-

 Select REPLACE ('Application','p', 'b')


Result:- Abblication