#import <Foundation/Foundation.h>

 

int main(int argc, const char * argv[]) {

    @autoreleasepool {

       //判断字符串是否有此前缀

        NSString *str=@"IOS8-赵玉鑫.jpg";

      BOOL result = [str hasPrefix:@"IOS"];

        NSLog(@"%d",result);

       //判断字符串是否有此后缀

      BOOL resultsu = [str hasSuffix:@".jpg"];

        NSLog(@"%d",resultsu);

    }

    return 0;

}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-23
  • 2021-12-17
  • 2022-12-23
  • 2021-06-28
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案