diff Stocks/Stocks.Common/Core/ExtensionMethods.cs @ 0:e5d46bb6cdb0

Initial commit
author adminSH stevenhollidge@hotmail.com
date Mon, 20 Feb 2012 13:52:35 +0700
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Stocks/Stocks.Common/Core/ExtensionMethods.cs	Mon Feb 20 13:52:35 2012 +0700
@@ -0,0 +1,18 @@
+using System;
+
+namespace Stocks.Common.Core
+{
+  public static class StringHelper
+  {
+    /// <summary>
+    /// Receives string and returns the string with its letters reversed.
+    /// </summary>
+    public static string Reverse(this string s)
+    {
+      if (s == null) return null;
+      char[] arr = s.ToCharArray();
+      Array.Reverse(arr);
+      return new string(arr);
+    }
+  }
+}