上述算法删除字符串左右(或是其中之一)满足predicate的字符。
predicate是一个一元判断式。
例:
string str(“---hello---”);
boost::trim_if(str, bind2nd(equal_to<char>(), ’-‘));//str==”hello”
predicate 判断式
string algorithm中提供了一些与字符串相关的判断式。
bool starts_with (input, test);
bool starts_with (input, test, comp)
bool istarts_with(input, test, local)