Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. using System;
  2.  
  3. public class Palindrome
  4. {
  5. public static bool IsPalindrome(string word)
  6. {
  7. word = word.ToLower();
  8. string reverse = "";
  9. for(int i = word.Length -1; i > -1; i--){
  10. reverse += word[i];
  11. }
  12. if(word == reverse){
  13. return true;
  14. }
  15. return false;
  16. }
  17.  
  18. public static void Main(string[] args)
  19. {
  20. Console.WriteLine(Palindrome.IsPalindrome("Deleveled"));
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement