How to remove specific content form strings on odd index lines in text file
<p>I'm trying to replace for specific content in strings located only on the odd index number lines inside text document about 30 000 rows, and avoid it for even lines content. For example with index numbers just to see: </p>

<pre><code>0. some text a2 
1. a1 some text a3 
2. some a3 text
3. some text a3
4. some a4 text 
</code></pre>

<p>I want use list for string values which must be removed:</p>

<pre><code>var valueList1 = new List&lt;string&gt; { "a1", "a2", "a3", "a4" }; 
</code></pre>

<p>But I'm not sure how to get line by index to replace it this way</p>

<pre><code>if (index % 2 == 0)  
{
   string text = File.ReadAllText(path);
          text = text.Replace("a1", "")
                     .Replace("a2", "")
                     .Replace("a3", "")
                     .Replace("a4", "");
   File.WriteAllText(path, text);  
}
</code></pre>

<p>to get this result in text document:</p>

<pre><code>some text a2 
some text 
some a3 text
some text  
some a4 text 
</code></pre>