StringHelper Class | Helper帮助文档 |
字符串操作类
Inheritance Hierarchy
Namespace: HD.Common
Assembly: HD.Common (in HD.Common.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public class StringHelper
Public Class StringHelper
public ref class StringHelper
type StringHelper = class end
The StringHelper type exposes the following members.
Constructors
Name | Description | |
---|---|---|
StringHelper | Initializes a new instance of the StringHelper class |
Methods
Name | Description | |
---|---|---|
ClearInputText |
清除字符串中的危险字符
| |
ClipString |
截取指定长度字符串
| |
DelLastChar |
删除最后结尾的指定字符后的字符
| |
DelLastComma |
删除最后结尾的一个逗号
| |
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
GetArrayStr(ListInt32) |
得到数组列表以逗号分隔的字符串
| |
GetArrayStr(ListString, String) | ||
GetArrayValueStr |
得到数组列表以逗号分隔的字符串
| |
GetCleanStyle |
将字符串样式转换为纯字符串
| |
GetHashCode | (Inherited from Object.) | |
GetHtml | ||
GetLeftStr |
从字符串左边起给定的位置截取字符串
| |
GetMD5 |
根据配置对指定字符串进行 MD5 加密
| |
GetNewStyle |
将字符串转换为新样式
| |
GetSqlText |
截取文本,区分中英文字符,中文算两个长度,英文算一个长度,用于数据库存储
| |
GetStrArray(String) |
把字符串转 按照, 分割 换为数据
| |
GetStrArray(String, Char) |
分割字符串,按指定的字符分割
| |
GetStrLength |
得到字符串长度,一个汉字长度为2
| |
GetStrList(String, Char) |
把字符串按照分隔符转换成 List
| |
GetStrList(String, Char, Boolean) |
把字符串按照分隔符转换成 List
| |
GetSubStr |
检查字符串最大长度,返回指定长度的串
| |
GetType | (Inherited from Object.) | |
GetUniqueStrArray |
把字符串按照指定分隔符装成 List 去除重复
| |
HtmlToStr |
解析html成 普通文本
| |
HtmlToTxt |
HTML转行成TEXT
| |
IsNumberId |
检查一个字符串是否是纯数字构成的,一般用于查询字符串参数的有效性验证。(0除外)
| |
IsSafeSql |
是否安全
| |
MemberwiseClone | (Inherited from Object.) | |
QuickValidate |
快速验证一个字符串是否符合指定的正则表达式。
| |
safeInt |
返回安全整数类型
| |
SafeSql |
替换不安全sql
| |
safeStr |
转化为安全字符串 去除其中的英文单引号
| |
safeStrToSource |
把'还原成单引号
| |
safeText |
把字符串转化为安全的text内容
| |
safeTextToSource |
把经过安全的text内容转化为源字符串
| |
StrToHtml |
转换成 HTML code
| |
StrToId |
获取正确的Id,如果不是正整数,返回0
| |
ToDBC |
全角转半角的函数(DBC case)
| |
ToSBC |
半角转全角的函数(SBC case)
| |
ToString | (Inherited from Object.) |
See Also