daily pastebin goal
31%
SHARE
TWEET

Untitled

a guest Sep 14th, 2018 53 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. How to identify and remove newline and white spaces?
  2. for (int i=0;i<contentsOfFile.count; i++)
  3.  {
  4.         if(!([[contentsOfFile objectAtIndex:i]isEqual:@"n"]||[[contentsOfFile     objectAtIndex:i]isEqual:@""]))
  5.        [arrayToBereturned addObject:[contentsOfFile objectAtIndex:i]];
  6.  }
  7.    
  8. NSString *string = @"Hello, World!";
  9. NSCharacterSet *separator = [NSCharacterSet whitespaceAndNewlineCharacterSet];
  10. NSArray *stringComponents = [string componentsSeparatedByCharactersInSet:separator];
  11.    
  12. NSString* result = [yourString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top