ReplaceTrim 函数之asp实现过滤掉字符中所有的tab和回车和换行的代码
程序员文章站
2022-07-01 23:38:36
'================================================ '函数名:replacetrim '作 用:过滤掉...
'================================================
'函数名:replacetrim
'作 用:过滤掉字符中所有的tab和回车和换行
'================================================
public function replacetrim(byval strcontent)
on error resume next
dim re
set re = new regexp
re.ignorecase = true
re.global = true
re.pattern = "(" & chr(8) & "|" & chr(9) & "|" & chr(10) & "|" & chr(13) & ")"
strcontent = re.replace(strcontent, vbnullstring)
set re = nothing
replacetrim = strcontent
exit function
end function
'函数名:replacetrim
'作 用:过滤掉字符中所有的tab和回车和换行
'================================================
public function replacetrim(byval strcontent)
on error resume next
dim re
set re = new regexp
re.ignorecase = true
re.global = true
re.pattern = "(" & chr(8) & "|" & chr(9) & "|" & chr(10) & "|" & chr(13) & ")"
strcontent = re.replace(strcontent, vbnullstring)
set re = nothing
replacetrim = strcontent
exit function
end function