我希望在' \'之后获取字符串值来自这个NSString
NSString *text = @"\"jkhfjkhfds" ;
我该怎么做?
答案 0 :(得分:1)
@madhev试试这个..
NSString *text = @"\"jkhfjkhfds";
NSArray *arrSeparate = [text componentsSeparatedByString:@"\""];
NSLog(@"result = %@",[arrSeparate objectAtIndex:1]);
答案 1 :(得分:0)
NSString *text = @"\"jkhfjkhfds" ;
text = [text stringByReplacingOccurrencesOfString:@"\\" withString:@""];
text= [text stringByReplacingOccurrencesOfString:@"\"" withString:@""];
NSLOg( NSLog(@"result = %@",text)`;`