title: Sort a vector of strings by substrings?
body: <p>I have a vector containing a number of strings of the same form: </p>
  
  <pre><code>'12345 QWERTY'
  '23456 ASDFGH'
  '34567 ZXCVBN'
  </code></pre>
  
  <p>I need to sort them by code (int type) and by names (string type). I am thinking of using the <code>.substr()</code> function to ignore the numbers. Is there a way I could use this within the sort function?</p>
  
  <p>One attempt is to create a mapping function to compliment 'sort()':</p>
  
  <pre><code>bool mapFunc(string a, string b) 
  {
  return a.substr(6) &lt; b.substr(6));
  }
  </code></pre>
  
  <p>plug into the sort function: </p>
  
  <pre><code>sort(begin, end, mapFunc);
  </code></pre>
  
  <p>where 'begin' and 'end' are both iterators pointing to the beginning and end of my vector. </p>
  
  <p>Please correct me if Ive made any mistake here:)</p>