C# Char ToUpperInvariant
Description
Char ToUpperInvariant
converts the value of a Unicode
character to its uppercase equivalent using the casing rules of the invariant
culture.
Syntax
Char.ToUpperInvariant
has the following syntax.
public static char ToUpperInvariant(
char c
)
Parameters
Char.ToUpperInvariant
has the following parameters.
c
- The Unicode character to convert.
Returns
Char.ToUpperInvariant
method returns The uppercase equivalent of the c parameter, or the unchanged value of c,
if c is already uppercase or not alphabetic.
Example
The following code shows how to use the Char.ToUpperInvariant method.
using System;/*from ww w. ja v a2 s .c o m*/
using System.Globalization;
public class Example
{
public static void Main()
{
Char[] chars = {'e', 'E', 'i', 'I' };
foreach (var ch in chars) {
Console.Write(Char.ToUpperInvariant(ch));
}
}
}
The code above generates the following result.