Char.ToUpperInvariant(Char) Method in C#

In this article, we will discuss the Char.ToUpperInvariant(Char) method in C# with syntax and examples.

What is the Char.ToUpperInvariant() Method?

The Char.ToUpperInvariant() method uilizes traditionally invariant formatting rules to convert the value of a Unicode character to its uppercase equivalent.

The character you want to convert to uppercase is the only parameter this method needs, which returns the uppercase equivalent of that character according to the rules of the language.

Syntax:

It has the following syntax:

where c is the Unicode character to convert.

Return Value:

The return value of the function is,

  • When c is already uppercase or not alphabetic, the value of c remains unchanged.
  • If not, the uppercase equivalent of the c parameter will be returned.

Program 1:

Let us take an example to illustrate the Char.ToUpperInvariant() method in C#.

Output:

Char.ToUpperInvariant(Char) Method in C#

Program 2:

Let us take another example to illustrate the Char.ToUpperInvariant() method in C#.

Output:

Char.ToUpperInvariant(Char) Method in C#




Latest Courses