|
发表于 2020-4-1 23:30:01
|
显示全部楼层
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)[换行] in the string
if @IsRemoveChr10=1
begin
select @str=replace(@str,char(10),'')
end
return @str
end
|
|