using System;
namespace csharp.Example.System
{
public class DeterminingCharType
{
public static void Main(string[] args)
{
Console.WriteLine("please enter character");
char c = Convert.ToChar(Console.ReadLine());
if (Char.IsDigit(c))
{
Console.WriteLine("Char " + c + " is digit");
}
else if (Char.IsNumber(c))
{
Console.WriteLine("Char " + c + " is number");
}
else if (Char.IsSeparator(c))
{
Console.WriteLine("Char " + c + " is separator");
}
else if (Char.IsSymbol(c))
{
Console.WriteLine("Char " + c + " is symbol");
}
else if (Char.IsControl(c))
{
Console.WriteLine("Char " + c + " is control");
}
else if (Char.IsLetter(c))
{
Console.WriteLine("Char " + c + " is letter");
}
else if (Char.IsPunctuation(c))
{
Console.WriteLine("Char " + c + " is punctuation");
}
else if (Char.IsSurrogate(c))
{
Console.WriteLine("Char " + c + " is surrogate");
}
else if (Char.IsWhiteSpace(c))
{
Console.WriteLine("Char " + c + " is whitespace");
}
Console.ReadLine();
}
}
}
Be Different with excellent knowledge A Devloper Blog....
Subscribe to:
Post Comments (Atom)
AngularJS Basics - Part 1
AngularJS What is AngularJS · Framework by googl...
-
Make Your Own Notepad In this tutorial we will be making a simple C# Notepad with the option to Clear, Cut, Copy, Paste, Select All, Save...
-
What is View? A simple view can be thought of as a subset of a table. It can be used for retrieving data, as well as updating or deleting r...
No comments:
Post a Comment
Your comment is pending for approval