On Mon, Jan 12, 2009 at 09:18:03PM +0100, Aristotle Pagaltzis wrote:
: Plus if there are separate `.ltrim` and `.rtrim` functions it
: would be better to implement `.trim` by calling them rather than
: vice versa, so it wouldn’t even be less efficient two make two
: calls rather than a parametrised one.

Depends on your string implementation if they're non-destructive,
since they potentially have to copy the middle of the string twice if
your implementation can't support one string pointing into the middle
of another.  And again, I think .trim should be non-destructive,
and .=trim should be the destructive version.

Larry

Reply via email to