title: Javascript substring not working as expected with long string
body: <p>I have a VERY long string containing code from a Rich Text Editor. I need to split this up into 4 parts to save it to the database. I am doing this.</p>
  
  <pre><code>var fullPart = $('#summernote').summernote('code').replace("'", "\'");
  var markupStr = fullPart.substring(0, 3000000);
  var markupStr2 = fullPart.substring(3000000, 3000000);
  var markupStr3 = fullPart.substring(6000000, 3000000);
  var markupStr4 = fullPart.substring(6000000);
  </code></pre>
  
  <p>markupStr, markupStr3 and markupStr4 all contain values, but markupStr2 is empty.  What am I doing wrong?</p>