开发者

I want to use characterAtIndex:(NSUInteger)index method of NSString class

I want to compare the value returned by characterAtIndex:(NSUInteger)index of NSString class wit开发者_JAVA技巧h a another NSString having one character stored in it any suggestion


On the top of my head, you can compare them directly using characterAtIndex on the other NSString as well.

if([string characterAtIndex:index] == [stringWithOneChar characterAtIndex:0]){
   // Do something here...
}


NSString *temp = @"Hello";
NSString *temp2 = @"H";

if([temp characterAtIndex:0] == [temp2 characterAtIndex:0] )
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜