This is my favourite way to iterate through a string. You can do what you want per word.
string line = "a line of text to iterate through"; string word; istringstream iss(line, istringstream::in); while( iss >> word ) { ... }
标签:
This is my favourite way to iterate through a string. You can do what you want per word.
string line = "a line of text to iterate through"; string word; istringstream iss(line, istringstream::in); while( iss >> word ) { ... }
标签:
原文地址:http://www.cnblogs.com/miaoz/p/4185963.html