asp截取字符串函数_asp怎么截取字符串
2017-06-27 15:10
225 查看
asp截取字符串函数_asp怎么截取字符串
'截取字符串 strvalue(标题,字数)
<%
function strvalue(str,lennum)
dim p_num
dim i
if strlen(str)<=lennum then
strvalue=str
else
p_num=0
x=0
do while not p_num > lennum-2
x=x+1
if asc(mid(str,x,1))<0 then
p_num=int(p_num) + 2
else
p_num=int(p_num) + 1
end if
strvalue=left(trim(str),x)&"…"
loop
end if
end function
function strlen(str)
dim page_len
page_len=0
strlen=0
if trim(str)<>"" then
page_len=len(trim(str))
for xx=1 to page_len
if asc(mid(str,xx,1))<0 then
strlen=int(strlen) + 2
else
strlen=int(strlen) + 1
end if
next
end if
end function
%>
<%=strvalue("准确的编程语言,可正确对代码语法着色,输入简单几个字的代码片段说明",10)%>
原文地址:http://www.jb51.net/article/62405.htm
'截取字符串 strvalue(标题,字数)
<%
function strvalue(str,lennum)
dim p_num
dim i
if strlen(str)<=lennum then
strvalue=str
else
p_num=0
x=0
do while not p_num > lennum-2
x=x+1
if asc(mid(str,x,1))<0 then
p_num=int(p_num) + 2
else
p_num=int(p_num) + 1
end if
strvalue=left(trim(str),x)&"…"
loop
end if
end function
function strlen(str)
dim page_len
page_len=0
strlen=0
if trim(str)<>"" then
page_len=len(trim(str))
for xx=1 to page_len
if asc(mid(str,xx,1))<0 then
strlen=int(strlen) + 2
else
strlen=int(strlen) + 1
end if
next
end if
end function
%>
引用
<%=strvalue("准确的编程语言,可正确对代码语法着色,输入简单几个字的代码片段说明",10)%>原文地址:http://www.jb51.net/article/62405.htm
相关文章推荐
- Asp.Net截取字符串输出
- [Asp.Net]按字符串实际长度截取定长字符窜
- asp.net(c#) datelist DataGrid 中截取字符串加"..." 和 鼠标放上去字符全部
- asp字符串操作 asp字符串函数 asp字符串使用实例
- asp截取指定英汉混合字符串_支持中文
- asp.net(c#) datelist DataGrid 中截取字符串加"..." 和 鼠标放上去字符全部显示
- asp.net 页面截取一定长度(显示长度)字符串函数
- asp.net截取字符串方法
- asp可用下列函数截取字符串
- ASP截取字符串函数
- Asp.Net截取字符串输出
- 类库------对一些字符串进行操作的类1.判断输入是否数字2.截取字符串函数3.过滤输入信息4.生成随机数5.生成验证码图片6.获取汉字第一个拼音7.半角转全角8.全角转半角
- ASP中截取字符串的方法
- asp 字符串截取函数
- asp.net(c#) datelist DataGrid 中截取字符串加"..." 和 鼠标放上去字符全部显示
- asp.net(c#) datelist DataGrid 中截取字符串加"..." 和 鼠标放上去字符全部显示
- asp 字符串截取函数
- GetBody asp实现截取字符串的代码
- 一个截取字符串函数,参数列表(源字符串,开始字符串,结束字符串)
- ASP截取字符串