Asp截取字符长度函数
来源:互联网 发布:ubuntu 14.04 u盘 编辑:程序博客网 时间:2024/05/16 04:40
提供你一个超级好用的函数,使用方法
response.write FixString(需要截取的字符串,字符串字节长度汉字算2个,如果被截取添加省略点的个数)
Function FixString(ByVal strWord, ByVal intByteLength, ByVal intPadDotAmount)
If strWord > "" Then
If Length(strWord) <= intByteLength Then
FixString = strWord
Else
Dim i
Dim intLength
Dim strChar
Dim bytChar
intLength = 0
For i = 1 to Len(strWord)
strChar = Mid(strWord, i, 1)
bytChar = Asc(Mid(strWord, i, 1))
If bytChar < 0 or bytChar > 255 Then
intLength = intLength + 2
Else
intLength = intLength + 1
End If
If intLength > intByteLength Then Exit For
FixString = FixString & strChar
Next
FixString = FixString & String(intPadDotAmount, ".")
End If
Else
FixString = ""
End If
End Function
response.write FixString(需要截取的字符串,字符串字节长度汉字算2个,如果被截取添加省略点的个数)
Function FixString(ByVal strWord, ByVal intByteLength, ByVal intPadDotAmount)
If strWord > "" Then
If Length(strWord) <= intByteLength Then
FixString = strWord
Else
Dim i
Dim intLength
Dim strChar
Dim bytChar
intLength = 0
For i = 1 to Len(strWord)
strChar = Mid(strWord, i, 1)
bytChar = Asc(Mid(strWord, i, 1))
If bytChar < 0 or bytChar > 255 Then
intLength = intLength + 2
Else
intLength = intLength + 1
End If
If intLength > intByteLength Then Exit For
FixString = FixString & strChar
Next
FixString = FixString & String(intPadDotAmount, ".")
End If
Else
FixString = ""
End If
End Function
- Asp截取字符长度函数
- asp 截取字符函数
- PHP函数-字符长度与截取
- ASP按字符长度精准截取中英文标题
- 截取字符长度
- php截取字符长度
- PHP截取字符串,获取长度,获取字符位置的函数
- Asp取实际字符长度函数
- asp函数截取字符串左边的限定长度
- asp函数截取字符串左边的限定长度
- CSS截取固定长度字符
- jstl截取字符长度处理
- 处理中英文字符长度截取
- 使用css截取字符长度
- asp截取中英文字符
- asp.net 页面截取一定长度(显示长度)字符串函数
- asp.net准确截取文本长度(取得标题的字符数)
- 截取字符函数
- java 试题
- 职位:JAVA高级开发,系统架构工程师
- Asp 时间格式化函数 FormatDateTime
- oracle clob
- asp函数截取字符串左边的限定长度
- Asp截取字符长度函数
- 用 Javascript 获取指定页面元素的位置
- DATEDIFF与dateadd在access和mssql下的使用例子
- 创建自定义类型的强类型化集合
- 职位:C++开发人员(都是北京职位)
- 正则表达式
- 转 关于查询语句
- The Inventor Mentor-第十五章 拖拽器和操作器
- C++引用