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

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

//获取字符串中的数字

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

输出12321123

 

转载于:https://www.cnblogs.com/lulushen/p/9884873.html

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐