CSharp · Console
using System;
public class Program
{
public static void Main()
{
string[] myArray = new string[3];
myArray[0] = "Hello World";
myArray[1] = "This is a sample code";
myArray[2] = "Delete me";
foreach(var s in myArray) {
Console.WriteLine(s);
}
Console.WriteLine("=================");
// One specific entry
myArray[1] = myArray[1].Replace("code", "");
foreach(var s in myArray) {
Console.WriteLine(s);
}
Console.WriteLine("=================");
// All entries
for(int i = 0; i < myArray.Length; i++) {
myArray[i] = myArray[i].Replace("code", "");
}
foreach(var s in myArray) {
Console.WriteLine(s);
}
}
}