-
ASP 删除字符串开始或/和末尾处指定字符(串)
- '删除字符串开始处指定字符(串)
- 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
-
相关阅读:
C#通过反射获取类中的方法和参数个数,反射调用方法带参数
C#利用WinRAR实现压缩和解压缩
C# 使用HttpWebRequest Post提交数据,携带Cookie和相关参数示例
C#使用Linq To XML读取XML,Linq生成XML,Linq创建带属性或带节点XML
MVC使用Newtonsoft无需实体类,实现JSON数据返回给前端页面使用
JSON对象与字符串之间的相互转换
Javascript正则表达式详细讲解和示例,通俗易懂
C#比较两个list集合,两集合同时存在或A集合存在B集合中无
Uploadify 3.2上传文件,限制类型,大小,传递参数等
c# 反射得到实体类的字段名称和值,DataTable转List<T>
-
原文地址:https://www.cnblogs.com/shoupifeng/p/2285520.html
Copyright © 2020-2023
润新知