The manual entry for [man]trim/man says it will "strip whitespace". This means it will escape such characters as a carriage return (\r) or a line feed (\n).
You have neither one of those, however - you have 4 characters - two backslashes, one 'r', and one 'n'. Now, if you're talking about this:
$string = "this has new lines\r\n";
then trim() will strip the new lines at the end.
If you visit the manual page and read about what a [man]string[/man] is, you'll see that these 'escape sequences' are only parsed in double quoted strings.