Step through your code in the debugger and you should see what is going on. In your outer foreach "entry" will be something in your datatable, let's say "∗test". Your inner foreach declares "cleanedEntry" to be "entry" with "*" removed so cleanedEntry becomes "test" but entry is still "∗test". The next loop will remove any "~" in "entry", but entry is still "*test" so cleanedEntry is now "∗test" and so on. What you want to do is all the removals on the same string variable
foreach (string entry in table)
{
cleanedEntry = entry;
foreach (string c in charToRemove)
{
cleanedEntry = cleanedEntry.Replace(c, string.Empty);
}
Console.WriteLine(i + " " + cleanedEntry);
i++;
}
That probably gives you another problem though, your orignal "table" List will remain unchanged as when you enumerate through the values you get a copy of the value rather than a reference to the value so your removal is done on a copy of the string in the List, not the List itself so that stays unchanged. To update the actual List;
List<string> table = dtbl.AsEnumerable().Select(r => r.Field<string>(0)).ToList();
for(int i = 0; i < table.Count; i++)
{
foreach (string c in charToRemove)
{
table[i] = table[i].Replace(c, string.Empty);
}
Console.WriteLine(i + " " + table[i]);
}