title: From ... In ... Select in C#
body: <p>Are there any disadvantages or performance slowdowns related to the use of expressions like</p>
  
  <pre><code>from i in Enumerable.Range(1, Math.Min(strTexto.Length, tamMax) + 1)
                  select Tuple.Create(strTexto.Substring(0, i - 1), strTexto.Substring(i - 1))
  </code></pre>
  
  <p>in C#? Is it preferable to build "hard-coded queries" like</p>
  
  <pre><code>foreach (Int32 IntTmp in SomeListWithTheRange)
      SomeListWithTheTuples.Add(new Tuple&lt;String, String&gt; (strTexto.Substring(0, i - 1), strTexto.Substring(i - 1)))
  </code></pre>
  
  <p>?</p>
  
  <p>While the first one seems more readable at first glance, I have noticed that this kind of queries can get very slow... For instance, the first query takes 11ms to perform, while the second one takes only 1ms. Am I right? Just want to make sure since I need to implement lots of these kind of queries.</p>