I have on text s this lines:
myData = myData.Replace(".jpg", ">JPG<");
myData = myData.Replace(".gif", ">GIF<");
myData = myData.Replace(".png", ">PNG<");
myData = myData.Replace(".tif", ">TIF<");
and on my C# program i wont one by one, on a cicle for:
for (int l=0; w<listWithLines.Count;l++)
{
// MY LINE
// listWithLines[l]
}
If your intention is just to do string replacement (as in the example lines), and you are able to modify the text list, the best approach would be to provide just the replacement tokens in the list:
.jpg,>JPG<
.gif,>GIF<
.png,>PNG<
.tif,>TIF<
Then your C# code can be modified like this:
for (int l=0; w<listWithLines.Count;l++)
{
string[] strTokens = listWithLines[l].Split(',');
// MY LINE
myData = myData.Replace(strTokens[0], strTokens[1]);
}