Char.IsUpper() Method in C#


The Char.IsUpper() method in C# indicates whether the specified Unicode character is categorized as an uppercase letter.

Syntax

public static bool IsUpper (char ch);

Above, the parameter ch is the Unicode character to evaluate.

Let us now see an example to implement the Char.IsUpper() method −

Example

using System;
public class Demo {
   public static void Main(){
      bool res;
      char val = 'H';
      Console.WriteLine("Value = "+val);
      res = Char.IsUpper(val);
      Console.WriteLine("Is the value an uppercae letter? = "+res);
   }
}

Output

This will produce the following output −

Value = H
Is the value an uppercae letter? = True

Let us now see another example to implement IsUpper() method −

Example

using System;
public class Demo {
   public static void Main(){
      bool res;
      char val = 'j';
      Console.WriteLine("Value = "+val);
      res = Char.IsUpper(val);
      Console.WriteLine("Is the value an uppercae letter? = "+res);
   }
}

Output

This will produce the following output −

Value = j
Is the value an uppercae letter? = False

Updated on: 04-Nov-2019

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements