title: c++: Foreach line in string (not file)
body: <p>In c++, how can I iterate through each line in a <strong>string</strong>? There have been plenty of questions regarding reading a file line by line, but how can I do this with a <code>std::string</code>?</p>
  
  <p>For example, if I have the following string:</p>
  
  <pre><code>1051
  2232
  5152
  3821
  0021
  3258
  </code></pre>
  
  <p>How would I iterate through each number?</p>