title: Fastest way to retreive bitArray part
body: <p>The title says all. My current version is:</p>
  
  <pre><code>Public Function GetBitArrayPart(ByVal BitArray As BitArray, _
                                  ByVal IndexStart As Integer, _
                                  ByVal IndexEnd As Integer) As BitArray
  
      If IndexStart &lt; 0 OrElse IndexEnd &gt; BitArray.Length - 1 OrElse IndexEnd &lt; IndexStart Then
          Return New BitArray(0)
      End If
  
      Dim i As Integer
      Dim outputBA As New BitArray(IndexEnd - IndexStart + 1)
  
      For i = 0 To outputBA.Length - 1
          outputBA(i) = BitArray(IndexStart + i)
      Next
  
      Return outputBA
  
  End Function
  </code></pre>
  
  <p>I must specify that the sizes of lookup bitAarrays are big. I dont understand why using the <code>System.String</code> to store the same amount of information to retreive a part of that string is faster than using <code>BitArray</code>. For that reason I started to analize the performance of my functions.</p>