title: How fast is String.Substring relative to other methods of string processing?
body: <p>I'm using VB.NET to process a long fixed-length record. The simplest option seems to be loading the whole record into a string and using Substring to access the fields by position and length. But it seems like there will be some redundant processing within the Substring method that happens on every single invocation. That led me to wonder whether I might get better results using a stream- or array-based approach.</p>
  
  <p>The content starts out as a byte array containing UTF8 character data. A couple of other approaches I've thought of are listed below.</p>
  
  <ol>
  <li>Loading the string into a StringReader and reading blocks of it at a time</li>
  <li>Converting the byte array into a char array and accessing the characters positionally within the array</li>
  <li>(This one seems dumb but I'll throw it out there) Copying the byte array to a memory stream and using a StreamReader</li>
  </ol>
  
  <p>This is <em>definitely</em> premature optimization; the substring approach may be perfectly acceptable even if it's a few milliseconds slower. But I thought I'd ask before coding it, just to see if anyone could think of a reason to use one of the other approaches. </p>