annotate Stocks/Stocks.Common/Core/ExtensionMethods.cs @ 8:6e84a4c92378

FakeWebClientShim added and refactoring
author stevenh7776 stevenhollidge@hotmail.com
date Tue, 21 Feb 2012 17:05:47 +0700
parents e5d46bb6cdb0
children
rev   line source
0
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
1 using System;
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
2
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
3 namespace Stocks.Common.Core
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
4 {
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
5 public static class StringHelper
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
6 {
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
7 /// <summary>
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
8 /// Receives string and returns the string with its letters reversed.
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
9 /// </summary>
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
10 public static string Reverse(this string s)
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
11 {
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
12 if (s == null) return null;
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
13 char[] arr = s.ToCharArray();
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
14 Array.Reverse(arr);
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
15 return new string(arr);
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
16 }
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
17 }
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
18 }