Reputation:
I have on nsstring object in which sometimes phone number gets stored and sometimes email address, i just need to ask that how to find any character suppose @ in a string, when email address is typed.
Upvotes: 0
Views: 198
Reputation: 3984
This is how you could check for @ as a substring
if ([string rangeOfString:@"@"].location == NSNotFound) {
// Number
} else {
// Email
}
Upvotes: 1