从环信中找到的部分不错的代码,拿出来记录一下

 

是否是中文

-(BOOL)isChinese{
    NSString *match=@"(^[\u4e00-\u9fa5]+$)";
    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF matches %@", match];
    return [predicate evaluateWithObject:self];
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-28
  • 2021-07-25
猜你喜欢
  • 2021-10-17
  • 2022-12-23
  • 2021-11-14
  • 2021-08-10
  • 2021-07-31
  • 2021-12-29
相关资源
相似解决方案