C# 反转字符串方法

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 反转字符串
{
    class Program
    {
        static void Main(string[] args)
        {
            
            string ss = Reserver("abcdefg");
            Console.Write(ss);
            //数组里面有一个方法用来反转的 除了今天上午用到这个还可以用这个
        }
        /// <summary>
        /// 反转字符串
        /// </summary>
        /// <param name="s"></param>
        /// <returns></returns>
        static string  Reserver(string s)
        {
            char[] charA = s.ToCharArray();
            Array.Reverse(charA);
            return new string(charA);

        }
    }
}
原文地址:https://www.cnblogs.com/gdouzz/p/4774197.html