我有一个字符串数组,并且想从该数组中替换一个值。替换字符串数组中的项
例子:
string[] stud = new[] {"1","12","Mark","M"};
string[] otherStud = new [] {"2","16","MarkMark","F"};
我想更换Mark
与Tom
,那么结果应该是
结果:
string[] stud = new [] {"1","12","Tom","M"};
string[] otherStud = new [] {"2","16","TomTom","F"};
请提出任何解决方案。
感谢
这是没有有效的代码。 –
@Daniel Hilgarth。现在它是。 – Jehof