문자열 split

jjuiddong
이동: 둘러보기, 찾기
void htmlextract::Tokenize(const string& src, const string& delimiters, vector<string>& tokens)
{
	string::size_type lastPos = src.find_first_not_of(delimiters, 0); 	// Skip delimiters at beginning.
	string::size_type pos     = src.find_first_of(delimiters, lastPos); 	// Find first "non-delimiter".
	while (string::npos != pos || string::npos != lastPos)
	{
		tokens.push_back(src.substr(lastPos, pos - lastPos)); 		// Found a token, add it to the vector.
		lastPos = src.find_first_not_of(delimiters, pos); 		// Skip delimiters.  Note the "not_of"
		pos = src.find_first_of(delimiters, lastPos); 		// Find next "non-delimiter"
	}
}
개인 도구
이름공간

변수
행위
둘러보기
도구모음