Reverse a string

image_pdfimage_print
   
 

//The MIT License (MIT)
//http://arolibraries.codeplex.com/license
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace AroLibraries.ExtensionMethods.Strings
{
    public static class StringExt
    {

        public static string Ext_Reverse(this string s)
        {
            if (s == null) throw new ArgumentNullException("String is NULL");

            char[] charArray = s.ToCharArray();
            Array.Reverse(charArray);
            return new string(charArray);
        }

    }
}

   
     


This entry was posted in Data Types. Bookmark the permalink.