タグ

ブックマーク / www.air-green.net (1)

  • split : 文字列を分割 « airgreen

    photo credit: Emery_Way 自作: #include <string> #include <vector> #include <iostream> #include <boost/foreach.hpp> /** * split 関数 * @param str   文字列 * @param delim デリミタ * @return 分割された文字列 */ std::vector<std::string> split(std::string str, std::string delim) { std::vector<std::string > result; int start = 0, end; while ((end = str.find_first_of(delim, start)) != str.npos) { // if (end - start > 0) //

    hideAki
    hideAki 2010/04/21
    split
  • 1