I have a equation string and when I split it with a my pattern I get the folowing string array.

```
string[] equationList = {"code1","+","code2","-","code3"};

```

Then from this I create a list which only contains the codes.

```
List<string> codeList = {"code1","code2","code3"};

```

Then existing code loop through the codeList and retrieve the value of each code and replaces the value in the equationList with the below code.

```
foreach (var code in codeList ){

 var codeVal = GetCodeValue(code);

  for (var i = 0; i < equationList.Length; i++){
     if (!equationList[i].Equals(code,StringComparison.InvariantCultureIgnoreCase)) continue;
                        equationList[i] = codeVal;
                        break;
     }
}

```

I am trying to improve the efficiency and I believe I can get rid of the for loop within the foreach by using linq.

My question is would it be any better if I do in terms of speeding up the process?

If yes then can you please help with the linq statement?