System Type Char Methods With2 Arguments C# with Example



System Type Char Methods With2 Arguments C# with Example

 using System;

namespace CSharpFundamentals
{
    class SystemTypeCharMethodsWith2Arguments
    {
        private static void Main(string[] args)
        {
			string msg = "Hello World! 1#";
			Console.WriteLine("char.IsDigit at Position 3: {0}", char.IsDigit(msg, 3));
			Console.WriteLine("char.IsDigit at Position 13: {0}\n", char.IsDigit(msg, 13));

			Console.WriteLine("char.IsLetter at Position 0: {0}", char.IsLetter(msg, 0));
			Console.WriteLine("char.IsLetter at Position 5: {0}\n", char.IsLetter(msg, 5));
			
			Console.WriteLine("char.IsWhiteSpace at Position 5: {0}", char.IsWhiteSpace(msg, 5));	
			Console.WriteLine("char.IsWhiteSpace at Position 6: {0}\n", char.IsWhiteSpace(msg, 6));	
			
			Console.WriteLine("char.IsPunctuation at Location 11: {0}",char.IsPunctuation(msg, 11));
			Console.WriteLine("char.IsPunctuation at Location 12: {0}\n",char.IsPunctuation(msg, 12));
			
			Console.WriteLine("char.IsUpper at Location 6: {0}",char.IsUpper(msg, 6));
			Console.WriteLine("char.IsUpper at Location 7: {0}\n",char.IsUpper(msg, 7));
			
			Console.WriteLine("char.IsLower at Location 6: {0}",char.IsLower(msg, 6));
			Console.WriteLine("char.IsLower at Location 7: {0}\n",char.IsLower(msg, 7));
			
			Console.WriteLine("char.IsNumber at Location 13: {0}",char.IsNumber(msg, 13));
			Console.WriteLine("char.IsNumber at Location 12: {0}",char.IsNumber(msg, 12));
        }
    }
}
 

0 Comment's

Comment Form

Submit Comment