Advertisement
TeMePyT

Untitled

May 26th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. private static bool IsPalindrome(string str)
  2. {
  3.  
  4. if (str.Length == 1 || str.Length == 0) return true;
  5. return str[0] == str[str.Length - 1] && IsPalindrome(str.Substring(1, str.Length - 2));
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement