Reputation: 117
I want get the string value after the '\' from this NSString
NSString *text = @"\"jkhfjkhfds" ;
How can I do it??
Upvotes: 0
Views: 54
Reputation: 57
NSString *text = @"\"jkhfjkhfds" ;
text = [text stringByReplacingOccurrencesOfString:@"\\" withString:@""];
text= [text stringByReplacingOccurrencesOfString:@"\"" withString:@""];
NSLOg( NSLog(@"result = %@",text)`;`
Upvotes: 0
Reputation: 2581
@madhev try this..
NSString *text = @"\"jkhfjkhfds";
NSArray *arrSeparate = [text componentsSeparatedByString:@"\""];
NSLog(@"result = %@",[arrSeparate objectAtIndex:1]);
Upvotes: 1