ASP中一个字符串处理类(加强)(VBScript)(4) 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