I have an url - NSString
- that I obtained from an RSS feed. Unfortunately it contains a lot of white space, that I can't remove with the below code. I'm using the same code for the same work for months, but this time it does not work properly for this feed. Somehow there will be also a whitespaces, but these are not /n
-s. When I click to its row on the database and trying to go through on it with the directional keys from the right to the left the cursor jumps 4-5 whitespaces everytime I tap the left arrow directional key instead of 1 whitespace per button press. Do anybody have an idea how should I handle this situation? Is it possible to remove every other typed whitespaces? Or what would be the best approach?
NSString *stringForUrl = [feedObject[@"link"] stringByTrimmingCharactersInSet:
[NSCharacterSet whitespaceCharacterSet]];
stringForUrl = [stringForUrl stringByReplacingOccurrencesOfString:@"\n" withString:@""];
stringForUrl = [stringForUrl stringByReplacingOccurrencesOfString:@" " withString:@""];
stringForUrl = [stringForUrl stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]];