function.asp
来自「这是我根据动网新闻核心自行设计的校园新闻系统」· ASP 代码 · 共 50 行
ASP
50 行
<%
'###########以下为常用函数###########
'文本处理1效果:去掉前后空格,并进行HTML代码编译,替换单引号"'"
'一般用于写入数据库文本的处理
function FormatText(text)
text=trim(text)
text=server.htmlencode(text)
text=replace(text,"'","''")
FormatText=text
end function
'文本处理2效果:去掉前后空格,允许HTML代码,替换单引号"'"
'一般用于需要写入html代码的文本格式化
function FormatTextHtml(text)
text=trim(text)
text=replace(text,",","''")
FormatTextHtml=text
end function
'文本处理3效果:替换文本区中输入的换行回车。
'一般用于显示一段文字
function FormatTextChr(text)
text=replace(text,chr(13),"")
text=replace(text,chr(10),"<br>")
FormatTextChr=text
end function
'并经过处理返回数组形式(去除空行)
function GetSplit(text)
dim textsplit
text=replace(text,chr(13),"")
textsplit=split(text,chr(10))
text=""
for i=0 to ubound(textsplit)
if not isnull(textsplit(i)) and textsplit(i)<>"" then
text=text&trim(textsplit(i))&"$$"
end if
next
text=left(text,len(text)-2)
textsplit=split(text,"$$")
GetSplit=textsplit
end function
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?