For example I have the following code:
string Sheet[] = new string[]{
"ABCDEFG",
"1234567",
"abcdefg" };
while(true){
Console.SetCursorPosition(0, 0);
Console.WriteLine(string.Join(Environment.NewLine, Sheet)); }
string.replace(Oldchar, NewChar)
Strings are immutable in C#. This means you cannot change a string, but only create a new one from the old with specific changes.
For your case this means you have to replace all the strings in your array with new ones created by replacing C
with #
in the old ones
for(int i=0; i<Sheet.Length; i++) Sheet[i] = Sheet[i].Replace("C", "#");
or if you can replace the whole array:
Sheet = Sheet.Select(s => s.Replace("C", "#")).ToArray();
UPDATE: if you want to replace only a single character in a string, let's say the first occurence of 'C', you can do this:
for(int i=0; i<Sheet.Length; i++)
{
string old = Sheet[i];
int index = old.IndexOf('C');
if (index < 0) continue; // no C in this string
Sheet[i] = old.Remove(index, 1).Insert(index, "#");
}
So you remove the 1 characer and insert the new one.