iOS 判断Objective-C 字符串是否已i开头 you结尾

iOS 判断Objective-C 字符串是否已i开头 you结尾

 NSString *str = [NSString stringWithFormat:@"i Love you"];
    [str hasPrefix:@"i"] && [str hasSuffix:@"you"] == YES ? NSLog(@"是已i开头you结尾") : NSLog(@"不是已i开头you结尾");

请输入图片描述

标签: none

添加新评论

Title - Artist
0:00