Objective-C: Find numbers in string

前端 未结 7 1059
遇见更好的自我
遇见更好的自我 2020-11-27 04:37

I have a string that contains words as well as a number. How can I extract that number from the string?

NSString *str = @\"This is my string. #1234\";
         


        
7条回答
  •  遥遥无期
    2020-11-27 04:48

    NSPredicate is the Cocoa class for parsing string using ICU regular expression.

提交回复
热议问题