title: iterate through lines in a string c++
body: <p>here's what I need to do.  I have a string in C++.  For every line in the string, I need to append a few characters (like ">> ") to the beginning of the line.  What I am struggling with is a good way to split the string around newlines, iterate through the elements appending the characters, and then rejoin the string together.  I've seen a few ideas, such as <code>strtok()</code>, but I was hoping c++ strings would have something a little more elegant.</p>