入门经典学习1字符串操作

来源:互联网 发布:windows 10 自由幻想 编辑:程序博客网 时间:2024/04/28 14:00
  public  class BaseTest    {        public static void Chapter6()        {            Console.WriteLine("Please enter a message:");            string msg = Console.ReadLine();            Console.WriteLine("Reverse the English message and add double quote:");            string msg2 = "";            for (int i = msg.Length - 1; i >=0; i--)            {                msg2 += msg[i];            }            msg2 = "\"" + msg2.Replace(" ", "\" \"") + "\"";            Console.WriteLine(msg2);            Console.ReadKey();        }    }

原创粉丝点击