System Type Char C# with Example



System Type Char C# with Example

 using System;

namespace CSharpFundamentals
{
    class SystemTypeChar
    {
        private static void Main(string[] args)
        {
            Console.WriteLine("char.IsDigit('a'): {0}", char.IsDigit('a'));
            Console.WriteLine("char.IsDigit('1'): {0}\n", char.IsDigit('1'));

            Console.WriteLine("char.IsLetter('a'): {0}", char.IsLetter('a'));
            Console.WriteLine("char.IsLetter('1'): {0}\n", char.IsLetter('1'));

            Console.WriteLine("char.IsWhiteSpace(' '): {0}", char.IsWhiteSpace(' '));
            Console.WriteLine("char.IsWhiteSpace('H'): {0}\n", char.IsWhiteSpace('H'));

            Console.WriteLine("char.IsPunctuation('a'): {0}", char.IsPunctuation('a'));
            Console.WriteLine("char.IsPunctuation('?'): {0}\n", char.IsPunctuation('?'));

            Console.WriteLine("char.IsUpper('A'): {0}", char.IsUpper('A'));
            Console.WriteLine("char.IsUpper('a'): {0}\n", char.IsUpper('a'));

            Console.WriteLine("char.IsLower('A'): {0}", char.IsLower('A'));
            Console.WriteLine("char.IsLower('a'): {0}\n", char.IsLower('a'));

            Console.WriteLine("char.IsNumber('A'): {0}", char.IsNumber('A'));
            Console.WriteLine("char.IsNumber('1'): {0}\n", char.IsNumber('1'));

            Console.WriteLine("char.IsSymbol('A'): {0}", char.IsSymbol('A'));
            Console.WriteLine("char.IsSymbol('#'): {0}", char.IsSymbol('#'));
        }
    }
}
 

0 Comment's

Comment Form