更新时间:2023-02-06 17:05:19
试试这个
try this
static void Main(string[] args)
{
string[] myArray = { "Can", "you", "help me", "please", "?", "thank", "you", "very much", "." };
ReplaceWithNON(myArray);
}
private static void ReplaceWithNON(string[] myArray)
{
string[] patterns = { "the", "that", "(eg width)", "123", ".", "text", "for example", "help me", "very much" };
for (int i = 0; i < myArray.Length; i++)
{
if (patterns.Contains(myArray[i]))
myArray[i] = "NON";
}
}