2012-05-12から1日間の記事一覧

Boost で文字列の置換

boost::algorithm::replace_all_copy あたりを使うのが楽そう。 [ソース] #include <boost/algorithm/string.hpp> #include <iostream> int main(){ std::string source = "homuhomuhomu"; // 結果をコピーして返す auto result1 = boost::algorithm::replace_all_copy(source, "homu", "mado"); st</iostream></boost/algorithm/string.hpp>…