Replaces the new lines in a string with the given replacement characters.