title: Faster way to get substring in python?
body: <p>I am coding Skew Algorithm to construct the Suffix Array and I have a long string (length >= 4000).
  In Skew Algorithm, I have to construct the <strong>Triples Array</strong> and <strong>Sub-strings Array</strong>.</p>
  
  <p>For example : I have a string <code>s = 'abcddd'</code>.</p>
  
  <ul>
  <li><strong>Triples Array</strong> is : <code>'abc', 'bcd', 'cdd', 'ddd'</code></li>
  <li><strong>Sub-strings Array</strong> is : <code>'abcddd', 'bcddd', 'cddd', 'ddd', 'dd', 'd'</code> </li>
  </ul>
  
  <p>This is my solution :</p>
  
  <pre><code>import numpy as np
  
  # example
  string = 'abdcb.....' (length &gt;= 4000)
  temp = 'abdcb......###' (length &gt;= 4000)
  
  triples_arr = np.array([])
  sub_strings = np.array([])
  
  for i in range (0, len(temp) - 3):
      triples_arr = np.append(triples_arr, temp[i:i + 3])
      sub_strings = np.append(sub_strings, string[i:string_len])
  </code></pre>
  
  <p>With a long string (length >= 4000), it take a minute to complete.</p>
  
  <p>Is there any solution that I can decrease the processing time of that task?  </p>