STL的string已给我提供一些常用的算法(find,substr,erase,replace等),但在实现应用中远远不能满足需求,像trim,toupper,tolower这样简单的算法都不提供,我曾偶发现一个开源的C++库中简洁优雅实现了这些算法。
1.trimLeft
2.trimLeftInPlace
3.trimRight
4.trimRightInPlace
5.trim
6.trimInPlace
7.toUpper
8.toUpperInPlace
9.toLower
10.toLowerInPlace