aryaxt
aryaxt

Reputation: 77626

Objective-C - Using NSScanner to read string?

SO I am trying to read content of an html string.

[scanner scanUpToString:@"<" intoString:&result];

What is the fastest way to read the content into string but ignore the last character which in this case is "<". I don't want to do stringByReplacingOccuranceOfString, that would perform slow

Upvotes: 0

Views: 271

Answers (1)

Scott Austin
Scott Austin

Reputation: 356

NSScanner's

-scanUpToString:(NSString *)stopString intoString:(NSString *)result

does not include the stopString in the result; you don't need to ignore the last character, because it's not included.

Upvotes: 2

Related Questions