![]() ![]() ![]() | introductory-examples/simple-types/ex.cs - Demonstrations of the simple type char in C#. | Lecture 0 - slide 6 : 25 Program 2 |
public static void CharDemo(){ char ch1 = 'A', ch2 = '\u0041', ch3 = '\u00c6', ch4 = '\u00d8', ch5 = '\u00c5', // Æ, Ø, Å ch6, ch7; if (char.IsLetter(ch1)) Console.WriteLine("{0} is a classificed as a letter", ch1); Console.WriteLine("{0} {1} {2}", ch3, ch4, ch5); Console.WriteLine("{0} {1} {2}", char.ToLower(ch3), char.ToLower(ch4), char.ToLower(ch5)); ch7 = char.Parse("B"); Console.WriteLine("{0} {1}", char.GetNumericValue('3'), char.GetNumericValue('b')); Console.WriteLine("{0}", CharCode('a')); Console.WriteLine("{0}", CharCode(ch5)); }