Archive for the ‘ NSScanner ’ Category
Before we start with sample code using NSScanner, let us have a quick over of NSScanner from Apple. The NSScanner class is an abstract superclass of a class cluster that declares the programmatic interface for an object that scans values from an NSString object. An NSScanner object interprets and converts the characters of an NSString [ READ MORE ]
- (NSString *)flattenHTML:(NSString *)html { NSScanner *theScanner; NSString *text = nil; theScanner = [NSScanner scannerWithString:html]; while ([theScanner isAtEnd] == NO) { // find start of tag [theScanner scanUpToString:@"<" intoString:NULL] ; // find end of tag [theScanner scanUpToString:@">" intoString:&text] ; // replace the found tag with a space //(you can filter multi-spaces out later if you [ READ MORE ]
Enter your email address to subscribe to this blog and receive notifications of new posts by email.
Join 4 other followers
Get every new post delivered to your Inbox.