We should use ``rtrim()`` instead of ``trim()``, because otherwise (depending to the $delimiter/$before/$after) it's possible to remove also something from the beginning of the $parents variable.