fixed bug on rtrim for all-whitespace string
use string interpolation