How to split string using istringstream with other delimiter than whitespace?
<p>The following trick using <code>istringstream</code> to split a string with white spaces.</p>

<pre><code>int main() {
    string sentence("Cpp is fun");
    istringstream in(sentence);
    vector&lt;string&gt; vec = vector&lt;string&gt;(istream_iterator&lt;string&gt;(in), istream_iterator&lt;string&gt;());
    return 0;
}
</code></pre>

<p>Is there a similar trick to split a string with <code>any</code> delimiter? For instance, <code>|</code> in "Cpp|is|fun".</p>
