NSString * str = @"123/21年123"

 NSCharacterSet *nonDigitCharacterSet = [[NSCharacterSet decimalDigitCharacterSet] invertedSet];

//获取字符串中的数字

 str = [[str componentsSeparatedByCharactersInSet:nonDigitCharacterSet] componentsJoinedByString:@""];

输出12321123

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
  • 2022-12-23
猜你喜欢
  • 2021-08-03
  • 2022-12-23
  • 2022-01-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-22
相关资源
相似解决方案