title: Replace foreach loop with linq query while sending list<string> data one by one to server using Active MQ
body: <p>I'm trying to replace this <code>for-each</code> loop with <code>Linq</code> query. This loop is killing the performance. <code>str</code> contains <code>list&lt;string&gt;</code>. I have to read one by one each string from <code>str</code> and encode it then I need to publish it to the server using <code>AMQ</code>. </p>
  
  <pre><code>foreach (var item in str)
      {
          byte[] bytes = Encoding.UTF8.GetBytes(item);
          publisher.SendMessage(bytes);
      }
  </code></pre>