fork download
  1. using static System.Console;
  2.  
  3. public class Program {
  4. public static void Main() {
  5. WriteLine(checkPalindrome("ana"));
  6. WriteLine(checkPalindrome("abba"));
  7. WriteLine(checkPalindrome("oki"));
  8. }
  9. static bool checkPalindrome(string inputString) {
  10. if(inputString.Length >= 1 && inputString.Length <= 100_000) {
  11. for (var i = 0; i < inputString.Length / 2; i++) if (char.ToLower(inputString[i]) != char.ToLower(inputString[inputString.Length - i - 1])) return false;
  12. return true;
  13. }
  14. return false;
  15. }
  16. }
  17.  
  18. //https://pt.stackoverflow.com/q/359775/101
Success #stdin #stdout 0.02s 15932KB
stdin
Standard input is empty
stdout
True
True
False