string

来源:互联网 发布:windows打开网络发现 编辑:程序博客网 时间:2024/06/03 09:25

StringComparison 枚举

CurrentCulture使用区分区域性的排序规则和当前区域性比较字符串
CurrentCultureIgnoreCase通过使用区分区域性的排序规则、当前区域性,并忽略所比较的字符串的大小写,来比较字符串。
InvariantCulture使用区分区域性的排序规则和固定区域性比较字符串。
InvariantCultureIgnoreCase通过使用区分区域性的排序规则、固定区域性,并忽略所比较的字符串的大小写,来比较字符串。
Ordinal使用序号(二进制)排序规则比较字符串。
OrdinalIgnoreCase通过使用序号(二进制)区分区域性的排序规则并忽略所比较的字符串的大小写,来比较字符串。


public bool Equals (string value, StringComparison comparisonType)


Split

public string[] Split (string[] separator, StringSplitOptions options)
separator
Type: System.String[]

分隔此字符串中子字符串的字符串数组、不包含分隔符的空数组或 null

options
Type: System.StringSplitOptions

要省略返回的数组中的空数组元素,则为 StringSplitOptions.RemoveEmptyEntries;要包含返回的数组中的空数组元素,则为StringSplitOptions.None。

返回值

Type: System.String[]

一个数组,其元素包含此字符串中的子字符串,这些子字符串由 separator 中的一个或多个字符串分隔。 有关详细信息,请参阅“备注”部分。


Split(new string[] { "\n", "\r" }, System.StringSplitOptions.RemoveEmptyEntries);


0 0
原创粉丝点击