一段字符截取的函数,不知道两个的区别
比较一下函数?
不明白为什么硬要使用asc进行转换。。。。。。
------===========-------the first function---=============---------
function procstr(strtxt,slen)
nlen = 0
outstr=""
for psi=1 to len(strtxt)
asci=asc(mid(strtxt,psi,1))
if asci>0 and asci<=255 then
nlen = nlen + 1
if nlen<=slen then outstr=outstr+mid(strtxt,psi,1)
else
nlen = nlen + 2
if nlen<=slen then outstr=outstr+mid(strtxt,psi,1)
end if
next
procstr=outstr
if nlen>slen then procstr=procstr&"..."
End function
------===========-------the second function---=============---------
function procstr(strtxt,slen)
dim outstr
if len(strtxt)>slen then
outstr=left(strtxt,slen)
outstr=outstr&"..."
else
outstr=strtxt
end if
procstr=outstr
End function
请知道的帮忙分析一下
20分感谢:)