c#Reverse字符串

  class Program
    {
        static void Main(string[] args)
        {
           // 输出 ypoc si yek eht
            string str = "the key is copy";
            char[] arr = str.ToCharArray();
            Array.Reverse(arr);
            var result = new string(arr);
           //输出 copy is key the
            string[] ss = str.Split(new string[] { " " }, StringSplitOptions.None);
            var resilt = ss.Reverse();
            var temp = String.Join(" ", resilt);

            Console.WriteLine(temp);
            Console.ReadKey();
        }
    }            

 

posted @ 2016-04-21 14:03  直钩钓鱼  阅读(2890)  评论(0编辑  收藏  举报