fork(1) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string City = "NEW YORK CITY";
  8. string[] lstWord = City.ToLower().Split(' ');;
  9. string Capatilize_City = "";
  10. foreach (string s in lstWord)
  11. {
  12. string z = s.Substring(0, 1).ToUpper() + s.Substring(1, s.Length - 1);
  13. Capatilize_City += " " + z;
  14. }
  15. Capatilize_City = Capatilize_City.Trim();
  16. Console.WriteLine(Capatilize_City);
  17. }
  18. }
Success #stdin #stdout 0.03s 24216KB
stdin
Standard input is empty
stdout
New York City