 <p>You can call <a href="http://en.cppreference.com/w/cpp/string/basic_string/find"><code>std::string::find</code></a> in a loop and the use <a href="http://en.cppreference.com/w/cpp/string/basic_string/substr"><code>std::string::substr</code></a>.</p> <pre><code>std::vector&lt;std::string&gt; split_string(const std::string&amp; str, const std::string&amp; delimiter) { std::vector&lt;std::string&gt; strings; std::string::size_type pos = 0; std::string::size_type prev = 0; while ((pos = str.find(delimiter, prev)) != std::string::npos) { strings.push_back(str.substr(prev, pos - prev)); prev = pos + 1; } // To get the last substring (or only, if delimiter is not found) strings.push_back(str.substr(prev)); return strings; } </code></pre> <p>See example <a href="http://ideone.com/UHWNQW">here</a>.</p>