Learning boost 3 -- string algorithm 1[7]

[入库:2005年8月19日] [更新:2007年3月24日]

本文简介:选择自 heroboy2000 的 blog

上述算法删除字符串左右(或是其中之一)满足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)

本文关键:Learning boost 3 -- string algorithm 1
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top