开发者

NSString Character found

I have on n开发者_StackOverflowsstring 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.


This is how you could check for @ as a substring

if ([string rangeOfString:@"@"].location == NSNotFound) {
  // Number
} else {
  // Email
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜