''' @参数说明: - n [int]: 删除的字符个数
'''''''' @返回值: - [string] 删除后的字符串
''''****************************************************************************
public function trimEnd(byVal str, n)
value = Left(str, len(str)-n)
trimEnd = value
end function
''''****************************************************************************
'''''''' @功能说明: 检查字符character是否是英文字符 A-Z or a-z
'''''''' @参数说明: - character [char]: 检查的字符
'''''''' @返回值: - [bool] 如果是英文字符,返回TRUE,反之为FALSE
''''****************************************************************************
public function isAlphabetic(byVal character)
asciiValue = cint(asc(character))
if (65 <= asciiValue and asciiValue <= 90) or (97 <= asciiValue and asciiValue <= 122) then
isAlphabetic = true
else
isAlphabetic = false
end if
end function
''''****************************************************************************
'''''''' @功能说明: 对str字符串进行大小写转换
'''''''' @参数说明: - str [string]: 源字符串
'''''''' @返回值: - [string] 转换后的字符串
''''****************************************************************************
public function swapCase(str)
for i = 1 to len(str)
current = mid(str, i, 1)
if isAlphabetic(current) then
high = asc(ucase(current))
low = asc(lcase(current))
sum = high + low
return = return & chr(sum-asc(current))
else
return = return & current
end if
next
swapCase = return
end function
''''****************************************************************************
'''''''' @功能说明: 将源字符串str中每个单词的第一个字母转换成大写
'''''''' @参数说明: - str [string]: 源字符串
'''''''' @返回值: - [string] 转换后的字符串
''''****************************************************************************
public function capitalize(str)
words = split(str," ")
for i = 0 to ubound(words)
if not i = 0 then
tmp = " "
end if
tmp = tmp & ucase(left(words(i), 1)) & right(words(i), len(words(i))-1)
words(i) = tmp
next
capitalize = arrayToString(words)
end function
''''****************************************************************************
'''''''' @功能说明: 将源字符Str后中的''''过滤为''''''''
'''''''' @参数说明: - str [string]: 源字符串
'''''''' @返回值: - [string] 转换后的字符串
''''****************************************************************************
public function checkstr(Str)
If Trim(Str)="" Or IsNull(str) Then
checkstr=""
else
checkstr=Replace(Trim(Str),"''''","''''''''")
end if
End function
''''****************************************************************************
'''''''' @功能说明: 将字符串中的str中的HTML代码进行过滤
'''''''' @参数说明: - str [string]: 源字符串
'''''''' @返回值: - [string] 转换后的字符串
''''****************************************************************************
Public Function HtmlEncode(str)
If Trim(Str)="" Or IsNull(str) then
HtmlEncode=""
else
str=Replace(str,">",">")
str=Replace(str,"<"