I have NSString like this: @”text 932″.
How I can return number from this string. Number is always at the end of string, but i can’ t use stringWithRange, because number don’ t have constant length. So I’m seeking for better method.
I aslo want’ know how to return number from string like this @”text 3232 text”. I aslo don’ t know position of number.
There is any function that find number in string ?
Here is a solution that will work for both strings
The output of the
NSLogisEDIT
To handle decimals: