safeTrimTrailingSeparator