```
NSString *jsPath = @"https://dog.abcdef.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy.js";
// 判断是否是“https://”开头
[jsPath hasPrefix:@"https://"];
// 判断是否是“.js”结尾
[jsPath hasSuffix:@".js"];
// 判断是否包含“abcdef”
if([jsPath rangeOfString:@"abcdef"].location==NSNotFound) {
NSLog(@"不包含abcdef");
} else {
NSLog(@"包含abcdef");
```
网友评论