最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp 字符截取程序代码
时间:2022-07-02 23:04:54 编辑:袖梨 来源:一聚教程网
Public Function CutStr(byVal val,byVal length,byVal endStr)
Dim l,t,c,i
If val = "" Or IsNull(val) Then
CutStr = ""
Exit Function
End If
If length = "" Or Int(length) <= 0 Or IsNumeric(length) = False Then
CutStr = val
Exit Function
End If
val = LoseHTML(val)
l = Len(val)
length = Int(length)
t = 0
For i = 1 To l
c = Ascw(Mid(val,i,1))
If c < 0 Or c > 255 Then t = t + 2 Else t = t + 1
IF t >= length Then
CutStr = Left(val,i) & endStr
Exit For
Else
CutStr = val
End If
Next
End Function
Public Function LoseHtml(ContentStr)
If ContentStr = "" Or IsNull(ContentStr) Or IsEmpty(ContentStr) Then
LoseHtml = ""
Else
Dim tempLoseStr,regEx
tempLoseStr = Cstr(ContentStr)
Set regEx = New RegExp
regEx.Pattern = "*[^<>]*>"
regEx.IgnoreCase = True
regEx.Global = True
tempLoseStr = regEx.Replace(tempLoseStr,"")
LoseHtml = tempLoseStr
End if
End Function
相关文章
- 崩坏星穹铁道光锥直到明天的明天是什么属性 07-30
- 明日方舟终末地汤汤最强队伍搭配方法 07-30
- 城门血战 全新策略肉鸽塔防游戏试玩 07-30
- 城门血战:肉鸽塔防新体验 07-30
- 城门血战游戏介绍 塔防缝合自走棋 07-30
- 城门血战试玩实况 塔防玩家狂喜 07-30