📅  最后修改于: 2022-03-11 14:54:55.226000             🧑  作者: Mango
string stringToCheck = "text1";
string[] stringArray = { "text1", "testtest", "test1test2", "test2text1" };
foreach (string x in stringArray)
{
if (x == stringToCheck)
{
// Process...
}
}