Char.ToUpperInvariant(Char) Method

Definition

使用固定区域性的大小写规则,将 Unicode 字符的值转换为其大写等效项。Converts the value of a Unicode character to its uppercase equivalent using the casing rules of the invariant culture.

public:
 static char ToUpperInvariant(char c);
public static char ToUpperInvariant (char c);
static member ToUpperInvariant : char -> char
Public Shared Function ToUpperInvariant (c As Char) As Char

Parameters

c
Char

要转换的 Unicode 字符。The Unicode character to convert.

Returns

Char

c 参数的小写等效项,或者,如果 c 已经是大写字母或不是字母,则为 c 的未更改值。The uppercase equivalent of the c parameter, or the unchanged value of c, if c is already uppercase or not alphabetic.

Remarks

如果你的应用程序不受当前区域性的影响,并且依赖于以可预测方式更改的字符的大小写,请使用 ToUpperInvariant 方法。If your application is unaffected by the current culture and depends on the case of a character changing in a predictable way, use the ToUpperInvariant method. ToUpperInvariant 方法等效于 ToUpper(Char, CultureInfo.InvariantCulture)The ToUpperInvariant method is equivalent to ToUpper(Char, CultureInfo.InvariantCulture).

使用 String.ToUpperInvariant 将字符串转换为大写。Use String.ToUpperInvariant to convert a string to uppercase.

Applies to

See also