Check if string is palindrome in objective c

前端 未结 10 2331
执念已碎
执念已碎 2021-01-07 02:15

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

10条回答
  •  情书的邮戳
    2021-01-07 02:27

    We can also do this using NSRange like this...
    enter code  NSString *fullname=@"123321";
    NSRange rangeforFirst=NSMakeRange(0, 1);
    NSRange rangeforlast=NSMakeRange(fullname.length-1, 1);
    BOOL ispalindrome;
    for (int i=0; i

提交回复
热议问题