[v2] Strip whitespace (or other characters) from the end
of a string