Check if a character is Lower case in CSharp

Description

The following code shows how to check if a character is Lower case.

Example


//ww w .  j  a va2  s.  c  o  m
using System;  
  
class MainClass {     
  public static void Main() {     
    string str = "This is a test from java2s.com. $23"; 
    int i; 
 
    for(i=0; i < str.Length; i++) { 
      Console.Write(str[i] + " is"); 
      if(Char.IsLower(str[i])) 
        Console.Write(" lowercase"); 
      if(Char.IsUpper(str[i])) 
        Console.Write(" uppercase"); 
 
      Console.WriteLine(); 
    } 
 
  }     
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Data Types »




C# Data Types
Bool
Byte
Char
Decimal
Double
Float
Integer
Long
Short
String
C# Array
Array Example
Byte Array
C# Standard Data Type Format
BigInteger
Complex
Currency
DateTime
DateTimeOffset
DateTime Format Parse Convert
TimeSpan
TimeZone
Enum
Null
tuple
var