using System; using System.Linq; using System.Text; namespace DistributedPasswordCracker.Client.Utilities { class StringUtilities { public static String Capitalize(String str) { if (str == null) { throw new ArgumentNullException("str"); } if (str.Trim().Length == 0) { return str; } String firstLetterUppercase = str.Substring(0, 1).ToUpper(); String theRest = str.Substring(1); return firstLetterUppercase + theRest; } public static String Reverse(String str) { if (str == null) { throw new ArgumentNullException("str"); } if (str.Trim().Length == 0) { return str; } StringBuilder reverseString = new StringBuilder(); for (int i = 0; i < str.Length; i++) { reverseString.Append(str.ElementAt(str.Length - 1 - i)); } return reverseString.ToString(); } } }