我有一個字符串數組,並且想從該數組中替換一個值。替換字符串數組中的項
例子:
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