StringNormalizationExtensions.Normalize 方法

定义

规范化字符串。Normalizes a string.

重载

Normalize(String)

将字符串规范化为 Unicode 范式 C。Normalizes a string to a Unicode normalization form C.

Normalize(String, NormalizationForm)

将字符串规范化为指定的 Unicode 范式。Normalizes a string to the specified Unicode normalization form.

Normalize(String)

将字符串规范化为 Unicode 范式 C。Normalizes a string to a Unicode normalization form C.

public:
[System::Runtime::CompilerServices::Extension]
 static System::String ^ Normalize(System::String ^ value);
public static string Normalize (this string value);
static member Normalize : string -> string
<Extension()>
Public Function Normalize (value As String) As String

参数

value
String

要规范化的字符串。The string to normalize.

返回

一个新字符串,其文本值与 value 相同,但其二进制表示形式符合 Unicode 范式 C。A new string whose textual value is the same as value but whose binary representation is in Unicode normalization form C.

异常

valuenullvalue is null.

value 包含无效的 Unicode 字符。value contains invalid Unicode characters.

Normalize(String, NormalizationForm)

将字符串规范化为指定的 Unicode 范式。Normalizes a string to the specified Unicode normalization form.

public:
[System::Runtime::CompilerServices::Extension]
 static System::String ^ Normalize(System::String ^ value, System::Text::NormalizationForm normalizationForm);
[System.Security.SecurityCritical]
public static string Normalize (this string value, System.Text.NormalizationForm normalizationForm);
static member Normalize : string * System.Text.NormalizationForm -> string

参数

value
String

要规范化的字符串。The string to normalize.

normalizationForm
NormalizationForm

Unicode 范式。The Unicode normalization form.

返回

一个新字符串,其文本值与 value 相同,但其二进制表示形式符合 normalizationForm 范式。A new string whose textual value is the same as value but whose binary representation is in the normalizationForm normalization form.

属性

异常

valuenullvalue is null.

value 包含无效的 Unicode 字符。value contains invalid Unicode characters.

适用于