added trailing slash option on toString(trailing)