IsDigit, IsLetter, IsWhiteSpace, IsLetterOrDigit, IsPunctuation : Char « Data Types « C# / C Sharp






IsDigit, IsLetter, IsWhiteSpace, IsLetterOrDigit, IsPunctuation

    

using System;
using System.Collections.Generic;
using System.Text;

class Program {
    static void Main(string[] args) {
        Console.WriteLine("-> char.IsDigit('K'): {0}", char.IsDigit('K'));
        Console.WriteLine("-> char.IsDigit('9'): {0}", char.IsDigit('9'));
        Console.WriteLine("-> char.IsLetter('10', 1): {0}", char.IsLetter("10", 1));
        Console.WriteLine("-> char.IsLetter('p'): {0}", char.IsLetter('p'));
        Console.WriteLine("-> char.IsWhiteSpace('Hello There', 5): {0}",char.IsWhiteSpace("Hello There", 5));
        Console.WriteLine("-> char.IsWhiteSpace('Hello There', 6): {0}",char.IsWhiteSpace("Hello There", 6));
        Console.WriteLine("-> char.IsLetterOrDigit('?'): {0}",char.IsLetterOrDigit('?'));
        Console.WriteLine("-> char.IsPunctuation('!'): {0}",char.IsPunctuation('!'));
        Console.WriteLine("-> char.IsPunctuation('>'): {0}",char.IsPunctuation('>'));
        Console.WriteLine("-> char.IsPunctuation(','): {0}",char.IsPunctuation(','));
    }
}

   
    
    
  








Related examples in the same category

1.Get char type: control, digit, letter, number, punctuation, surrogate, symbol and white spaceGet char type: control, digit, letter, number, punctuation, surrogate, symbol and white space
2.Determining If A Character Is Within A Specified RangeDetermining If A Character Is Within A Specified Range
3.Is a char in a range: Case InsensitiveIs a char in a range: Case Insensitive
4.Is a char in a range ExclusivelyIs a char in a range Exclusively
5.Using Char
6.Escape Characters
7.A stack class for charactersA stack class for characters
8.Encode or decode a message
9.Demonstrate several Char methodsDemonstrate several Char methods
10.Demonstrate the ICharQ interface: A character queue interfaceDemonstrate the ICharQ interface: A character queue interface
11.A set class for charactersA set class for characters
12.A queue class for charactersA queue class for characters
13.Char: Get Unicode Category
14.Char.IsLowSurrogate(), IsHighSurrogate(), IsSurrogatePair() method
15.demonstrates IsSymbol.
16.Buffer for characters
17.Test an input character if it is contained in a character list.
18.Is vowel char
19.Filter letter and digit
20.First Char Upper