Find the dot in the string in xcode and remove content after dot (.)
Find the dot in the string in xcode and remove content after dot (.)
This will help you to remove the content after and before dot (.)
user id =user@abc.com
NSUserDefaults *standardUserDefaults2 = [NSUserDefaults standardUserDefaults];
userLogedIn = [standardUserDefaults2 objectForKey:@"useremail2"];
[userLogedIn stringByReplacingOccurrencesOfString:@"." withString:@""];
NSRange range = [userLogedIn rangeOfString:@"."];
userLogedIn = [userLogedIn substringWithRange:NSMakeRange(0, range.location)];
NSLog(@"user id==>%@",userLogedIn);
Output:
user@abc
Comments
Post a Comment