Questions tagged «string-comparison»

字符串比较是比较字符串的操作,结果是一个布尔值或一个整数,指示字符串之间的“距离”。


7
了解NSString比较
以下两个比较的评估结果均为true: 1) @"foo" == @"foo"; 2) NSString *myString1 = @"foo"; NSString *myString2 = @"foo"; myString1 == myString2; 但是,在某些情况下,肯定NSString无法使用相等运算符比较两个s,而是必须使用两个运算符[myString1 isEqualToString:myString2]。有人可以阐明这一点吗?


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.