I looked all over the NSString class reference but I can't seem to find out if I have a string, what method can I use to check if a particular character is inside of the string.
For example, if my string is
NSString * string = "123.32"
if ([string hasString:@"."]) {
//do stuff
so I don't really care the index that it is at but whether it has it or not :-)
You want rangeOfString:
— so, for example, [string rangeOfString:@"."].location != NSNotFound
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With