public static void StringCaps(string str) { int diff = 'A' - 'a'; StringBuilder sb = new StringBuilder(); char ch; foreach (char letter in str) { ch = (char)(letter + diff); sb.Append(ch); } Console.WriteLine(sb.ToString()); }
Login to post response