分行模块,自动识别英文和型号数
类别: ASP教程
Function cuttextlen(intext, lens)
If Len(intext) <= lens Then
cuttextlen = intext
Else
tmptext = intext
GetTexts = ""
Do While Not Len(tmptext) <= lens
GetTexts = GetTexts + Left(tmptext, lens)
tmptext = Right(tmptext, Len(tmptext) - lens)
Do While (Asc(Left(tmptext, 1)) >= 65 And Asc(Left(tmptext, 1)) <= 90) Or (Asc(Left(tmptext, 1)) >= 97 And Asc(Left(tmptext, 1)) <= 122) Or (Asc(Left(tmptext, 1)) >= 45 And Asc(Left(tmptext, 1)) <= 57)
GetTexts = GetTexts + Left(tmptext, 1)
tmptext = Right(tmptext, Len(tmptext) - 1)
\'If Len(tmptext) <= lens Then Exit Do
Loop
GetTexts = GetTexts & "<br>"
Loop
cuttextlen = GetTexts & tmptext
End If
End Function
If Len(intext) <= lens Then
cuttextlen = intext
Else
tmptext = intext
GetTexts = ""
Do While Not Len(tmptext) <= lens
GetTexts = GetTexts + Left(tmptext, lens)
tmptext = Right(tmptext, Len(tmptext) - lens)
Do While (Asc(Left(tmptext, 1)) >= 65 And Asc(Left(tmptext, 1)) <= 90) Or (Asc(Left(tmptext, 1)) >= 97 And Asc(Left(tmptext, 1)) <= 122) Or (Asc(Left(tmptext, 1)) >= 45 And Asc(Left(tmptext, 1)) <= 57)
GetTexts = GetTexts + Left(tmptext, 1)
tmptext = Right(tmptext, Len(tmptext) - 1)
\'If Len(tmptext) <= lens Then Exit Do
Loop
GetTexts = GetTexts & "<br>"
Loop
cuttextlen = GetTexts & tmptext
End If
End Function
- 上一篇: 个人经验:使用ASP尽量减少服务器端的工作量
- 下一篇: 用IIS+ASP建网站的安全性分析
-= 资 源 教 程 =-
文 章 搜 索