STUFF(Original_Expression, Start, Length, Replacement_expression)
STUFF() function inserts Replacement_expression, at the start position specified, along with removing the characters specified using Length parameter.
Select FirstName, LastName,Email, STUFF(Email, 2, 3, '*****') as StuffedEmail From Employee
Executing this example will result in returning the given table
FirstName | LastName | StuffedEmail | |
---|---|---|---|
Jomes | Hunter | James@hotmail.com | J*****s@hotmail.com |
Shyam | rathod | Shyam@hotmail.com | S*****m@hotmail.com |
Ram | shinde | Ram@hotmail.com | R*****hotmail.com |