Fx Developer
Pages
Home
Tips and Tricks
Tutorials
iPhone App
Contact
May 26, 2014
[iOS] is Numeric ?
The simplest way to get to know one string is a number.
+ (
BOOL
) isNumeric:(
NSString
*)str
{
NSScanner
*sc = [
NSScanner
scannerWithString
: str];
if
( [sc
scanFloat
:
NULL
] )
{
return
[sc
isAtEnd
];
}
return
NO
;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment