A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/c-sharp/c-sharp-char-isupper-method/ below:

C# | Char.IsUpper() Method - GeeksforGeeks

C# | Char.IsUpper() Method

Last Updated : 11 Jul, 2025

In C#,

Char.IsUpper()

is a

System.Char

struct method which is used to check whether a Unicode character can be categorized as an uppercase letter or not. Valid uppercase letters will be the members of the

UnicodeCategory: UppercaseLetter

. This method can be overloaded by passing different type and number of arguments to it.

  1. Char.IsUpper(Char) Method
  2. Char.IsUpper(String, Int32) Method
Char.IsUpper(Char) Method

This method is used to check whether the specified Unicode character matches any uppercase letter or not. If it matches then it returns True otherwise return False.

Syntax:
public static bool IsUpper(char ch);
Parameter:
ch: It is required Unicode character of System.char type which is to be checked.
Return Type:

The method returns True, if it successfully matches any uppercase letter, otherwise returns False. The return type of this method is

System.Boolean

.

Example: CSHARP
// C# program to illustrate the
// Char.IsUpper(Char) Method
using System;

class GFG {

    // Main Method
    static public void Main()
    {

        // Declaration of data type
        bool result;

        // checking if G is a
        // uppercase letter or not
        char ch1 = 'G';
        result = Char.IsUpper(ch1);
        Console.WriteLine(result);

        // checking if 'g' is a
        // uppercase letter or not
        char ch2 = 'g';
        result = Char.IsUpper(ch2);
        Console.WriteLine(result);
    }
}
Char.IsUpper(String, Int32) Method

This method is used to check whether the specified string at specified position matches with any uppercase letter or not. If it matches then it returns True otherwise returns False.

Syntax:
public static bool IsUpper(string str, int index);
Parameters:
Str: It is the required string of System.String type which is to be evaluate. index: It is the position of character in string to be compared and type of this parameter is System.Int32.
Return Type:

The method returns True if it successfully matches any uppercase letter at the specified index in the specified string, otherwise returns False. The return type of this method is

System.Boolean

.

Exceptions: Example: CSHARP
// C# program to illustrate the
// Char.IsUpper(String, Int32) Method
using System;

class GFG {

    // Main Method
    static public void Main()
    {

        // Declaration of data type
        bool result;

        // checking for uppercase letter in
        // a string at a desired position
        string str1 = "GeeksForGeeks";
        result = Char.IsUpper(str1, 5);
        Console.WriteLine(result);

        // checking for uppercase letter in a
        // string at a desired position
        string str2 = "geeksforgeeks";
        result = Char.IsUpper(str2, 2);
        Console.WriteLine(result);
    }
}
Reference: https://learn.microsoft.com/en-us/dotnet/api/system.char.IsUpper?view=netframework-4.7.2

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4