title: C++ code for taking substrings
body: <p>I have a string as "1.0.0" and I want to extract the "1", "0", and "0". If the last zero is not present, the string must store 0 by default:</p>
  
  <pre><code>verstr.substr(0,verstr.find(".");
  </code></pre>
  
  <p>The above statement can find the first digit that is "1", however, I am not able to think of a solution for extracting the remainder of the string.</p>
  
  <p>After this i convert it to a long as:</p>
  
  <pre><code>        va = atol(verstr.substr(0,verstr.find(".")).c_str());
  </code></pre>
  
  <p>so i want the "1" in va , 0 in "vb" and so on</p>
  
  <p>Thanks.</p>