comparison of two strings fails

后端 未结 4 514
借酒劲吻你
借酒劲吻你 2020-12-21 14:16

I make a comparison of two strings which are obviously identical. Unfortunately my if clause doesn´t work as expected:

NSLog(@\"%@ == %@ ?\",strippedString1,         


        
4条回答
  •  佛祖请我去吃肉
    2020-12-21 14:49

    With == you are comparing pointer address, to compare the contents of the strings you could use:

     [strippedString1 isEqualToString: strippedString2];
    

提交回复
热议问题