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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qiqingli/article/details/78863223
  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();
        }
    }

猜你喜欢

转载自blog.csdn.net/qiqingli/article/details/78863223