Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to identify and remove newline and white spaces?
- for (int i=0;i<contentsOfFile.count; i++)
- {
- if(!([[contentsOfFile objectAtIndex:i]isEqual:@"n"]||[[contentsOfFile objectAtIndex:i]isEqual:@""]))
- [arrayToBereturned addObject:[contentsOfFile objectAtIndex:i]];
- }
- NSString *string = @"Hello, World!";
- NSCharacterSet *separator = [NSCharacterSet whitespaceAndNewlineCharacterSet];
- NSArray *stringComponents = [string componentsSeparatedByCharactersInSet:separator];
- NSString* result = [yourString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
Add Comment
Please, Sign In to add comment