Note the difference between replacing the backslash char
NSString *original = @"foo\\bar";
NSLog(@"%@", original); // Prints: foo\bar
NSString *replaced = [original stringByReplacingOccurrencesOfString:@"\\" withString:@""];
NSLog(@"%@", replaced); // Prints: foobar
And replacing a char that is represented using a backslash (\r, \n, \t, ...):
NSString *original = @"thisIsCarriageReturn\rRightThere";
NSLog(@"%@", original); // Prints: thisIsCarriageReturn
// RightThere
NSString *replaced = [original stringByReplacingOccurrencesOfString:@"\r" withString:@""];
NSLog(@"%@", replaced); // Prints: thisIsCarriageReturnRightThere