title: string.substring vs string.take
body: <p>If you want to only take a part of a string, the substring method is mostly used.
  This has a drawback that you must first test on the length of the string to avoid errors.
  For example you want to save data into a database, and want to cut off a value to the first 20 characters. </p>
  
  <p>If you do  temp.substring(0,20) but temp only holds 10 chars, an exception is thrown.</p>
  
  <p>There are 2 solutions that I see :</p>
  
  <ol>
  <li>test on the length, and do the substring if needed </li>
  <li><p>use the extension method <strong>Take</strong></p>
  
  <pre><code>    string temp = "1234567890";
      var data= new string( temp.Take(20).ToArray());
      --&gt; data now holds "1234657890"
  </code></pre></li>
  </ol>
  
  <p>Is there any disadvantage in terms of speed or memory use , when one uses the Take method.
  The benefit is that you do not have to write all those if statements.</p>