掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
文字列を分解して直接std::stringに詰め込むに方法があるか? (ID:67302)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
tokenizer を使ってみた #include <boost/tokenizer.hpp> std::wstring source(L"Hello World"); typedef boost::tokenizer<boost::char_delimiters_separator<wchar_t>, std::wstring::const_iterator, std::wstring> wtokenizer; wtokenizer tk(source, boost::char_delimiters_separator<wchar_t>(true, L"", L"l")); for (wtokenizer::iterator it=tk.begin(); it!=tk.end(); ++it) { std::wcout << L'<' << *it << L'>' << std::endl; } 常に2つに分かれるのであれば繰り返す必要は無いが・・・
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.