|
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
create function [dbo]. [fn_removeChr13Chr10]
(
@str varchar (max) = 'helloworld',
@ IsRemoveChr13 bit = 1,
@ IsRemoveChr10 bit = 1
)
RETURNS varchar (max)
as
begin
--- remove the key char (13) [return] in the string
if @ IsRemoveChr13 = 1
begin
select @ str = replace (@ str, char (13), '')
end
--- remove the key char (10) [line feed] in the string
if @ IsRemoveChr10 = 1
begin
select @ str = replace (@ str, char (10), '')
end
return @str
end |
|