- '删除字符串开始处指定字符(串)
- Function TrimLeft(strIn, strTrim)
- If IsNull(strIn) Or strIn="" Then
- TrimLeft = ""
- Exit Function
- End If
- If IsNull(strTrim) Or strTrim="" Then
- TrimLeft = strIn
- Exit Function
- End If
- While (Left(strIn, Len(strTrim)) = strTrim)
- strIn = Mid(strIn, Len(strTrim) + 1)
- Wend
- TrimLeft = strIn
- End Function
-
- '删除字符串末尾处指定字符(串)
- Function TrimRight(strIn, strTrim)
- If IsNull(strIn) Or strIn="" Then
- TrimRight = ""
- Exit Function
- End If
- If IsNull(strTrim) Or strTrim="" Then
- TrimRight = strIn
- Exit Function
- End If
- While (Right(strIn, Len(strTrim)) = strTrim)
- strIn = Left(strIn, Len(strIn) - Len(strTrim))
- Wend
- TrimRight = strIn
- End Function
-
- '删除字符串开始/末尾处指定字符(串)
- Function TrimLeftRight(strIn, strTrim)
- If IsNull(strIn) Or strIn="" Then
- TrimLeftRight = ""
- Exit Function
- End If
- If IsNull(strTrim) Or strTrim="" Then
- TrimLeftRight = strIn
- Exit Function
- End If
- strIn = TrimLeft(strIn, strTrim)
- TrimLeftRight = TrimRight(strIn, strTrim)
- End Function
posted @
2011-12-13 08:29
shoupifeng
阅读(
3649)
评论()
编辑
收藏
举报