I would like to go through .txt document and store text blocks in NSStrings. My problem is that this document contains linebreaks, and i don’t know how to rid of those. It would be nice, if i could put each individual word into an ordered NSArray and then just go through that array and get information out from that. I would something like this:
// txt file
This is just a test.
End of the text file.
// NSArray and NSStrings
NSArray *wholeDocument =@"This","is","just","a","test","Foo","bar.", "End", "of", "the","text","file.";
NSString *beginDocument =@"This is just a test";
NSString *endDocument =@"End of the text file.";
Try this:
Here,
arrwill contain all the words which are separated either by spaces or by line breaks.