public static void Main()
StringHelper sh = new StringHelper();
Console.WriteLine("testing 'test': " + sh.isPalindrome("test one").ToString());
Console.WriteLine("testing 'racecar': " + sh.isPalindrome("racecar").ToString());
Console.WriteLine("testing 'a man a plan a canal panama': " + sh.isPalindrome("a man a plan a canal panama").ToString());
Console.WriteLine("testing 'orange': " + sh.isPalindrome("orange").ToString());
public class StringHelper
public bool isPalindrome(string str)
string reversedString = "";
if(!char.Equals(c, (char)32))
for(int i = temp.Length-1; i >= 0; i--)
reversedString += temp[i];
return reversedString.ToLower() == temp.ToLower();