Update Str.php

Added rtrim() to remove whitespace between the truncated string and the $end string which is appended.
Merge pull request #2857 from BlueHayes/master

Remove whitespace at the end of truncated portion in Str::limit()
Added sort flags
Corrected docblock formatting, and renamed $sort_flags to $options
Merge branch '4.0'