using System; class MainClass { public static void Main() { string str = "This is a test. $23"; int i; for(i=0; i < str.Length; i++) { Console.Write(str[i] + " is"); if(Char.IsWhiteSpace(str[i])) Console.Write(" whitespace"); Console.WriteLine(); } } }
T is h is i is s is is whitespace i is s is is whitespace a is is whitespace t is e is s is t is . is is whitespace $ is 2 is 3 is