tech74
tech74

Reputation: 1375

Remove chars upto specific one in NSString

if i have an NSString eg->

string(102)"?xml etc

How to remove all chars upto and including the double quote. I want to remove the string(102)"

Doing this NSString* newString = [str substringFromIndex:13] works but is not ideal

Upvotes: 0

Views: 229

Answers (1)

Wevah
Wevah

Reputation: 28242

NSRange range = [str rangeOfString:@"\""];
NSString *newString = [str substringFromIndex:range.location + range.length];

Is one way.

Upvotes: 1

Related Questions