C++ 字符串處理工具包

fmms 12年前發布 | 19K 次閱讀 C/C++開發 C/C++

C++ String Toolkit Library 是 C++ 模板化的字符串切割工具包,類似 Java 的 StringTokenizer 類。

  • Generic string tokenizer and token iterators
  • Split routines
  • User specified delimiter and splitter policies (simple and regex based etc.)
  • Conversions between data and hex and base-64
  • In-place removal and replace routines
  • Wild-card matching and globbing
  • Search and Replace
  • Fast token grid and Comma Separated Values (CSV and DSV) processing
  • Extremely fast String to Integer, Double and other POD conversions
  • Extensible string processing templates and algorithms (eg: combinatorics and randomizations)
  • Fast and simple-to-use binary serialization
  • Seamless integration with STL and Boost
  • Easy to use wrappers of common string processing usage patterns
  • Single header file solution requires no installation or building

C++ 字符串處理工具包

示例代碼:

strtk::multiple_delimiter_predicate(Iterator begin, Iterator end);

std::string str_delimiters = " ,.;:<>'[]{}()_?/'`~!@#$%^&*|-_\"=+";
strtk::multiple_delimiter_predicate mdp1(str_delimiters.begin(),str_delimiters.end());

unsigned int uint_delimiters[5] = {1,10,101,1010,10101};
strtk::multiple_delimiter_predicate mdp2(uint_delimiters,uint_delimiters + 5);

項目主頁:http://www.baiduhome.net/lib/view/home/1326940748671

 本文由用戶 fmms 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!