[表示 : 全て 最新50 1-99 101- 201- 301- 401- 501- 601- 701- 801- 901- 2chのread.cgiへ]
Update time : 01/29 10:31 / Filesize : 249 KB / Number-of Response : 964
[このスレッドの書き込みを削除する]
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧] [類似スレッド一覧]


↑キャッシュ検索、類似スレ動作を修正しました、ご迷惑をお掛けしました

はきだめC/C++下級者の質問箱 2



11 名前:デフォルトの名無しさん mailto:sage [2006/08/25(金) 23:22:57 ]
>>6
/**
文字列を指定の文字で分割し、単語のリストを作ります
@param text 入力文字列(","や";"を含む文字列)
@param separators 分裂文字列(",.;:","\n")
@param words 出力文字列リスト
*/
bool split(const string& text,
  const string& separators,
  vector<string>& words)
{
  int n = text.length();
  int start = text.find_first_not_of(separators);

  while ((start >= 0) && (start < n))
  {
     int stop = text.find_first_of(separators, start);
     if ((stop < 0) || (stop > n)) stop = n;
     words.push_back (text.substr(start, stop-start));
     start = text.find_first_not_of(separators, stop+1);
  }
  return true;
}






[ 続きを読む ] / [ 携帯版 ]

全部読む 次100 最新50 [ このスレをブックマーク! 携帯に送る ] 2chのread.cgiへ
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧]( ´∀`)<249KB

read.cgi ver5.27 [feat.BBS2 +1.6] / e.0.2 (02/09/03) / eucaly.net products.
担当:undef