I\'m trying to check if a string is palindrome or not using objective c. I\'m new to programming without any experience in other programming languages so bear with me please
var str: NSString = "123321" var length = str.length var isPalindrome = true for index in 0...length/2{ if(str.characterAtIndex(index) != str.characterAtIndex(length-1 - index)){ print("\(index )not palindrome") isPalindrome = false break } } print("is palindrome: \(isPalindrome)")