Boost logo

Boost :

From: Mark Rodgers (mark.rodgers_at_[hidden])
Date: 2001-08-18 15:59:28


> I'm still thinking of the string algorithm library as being "simple",
> possibly just 5-line-wrappers around <algorithm>. Therefore,
> I'd say we should use a null-terminated string of [wide] characters
> which are to be trimmed. (see std::string::find_first_not_of).

I'd like to see the default behaviour of a trim function to be to remove
characters where std::ctype<charT>::is(std::ctype_base::space,c) is true.
Thus I envisage a trim where the second argument is a locale with a
default argument of std::locale(). A trim with a string of characters
to be trimmed might be another overload:

template <class String>
void trim( String &s, const std::locale &loc = std::locale() );

template <class String>
void trim( String &s, typename String::const_pointer charsToTrim );

Mark


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk