📜  c# 字符串数组包含 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:44.144000             🧑  作者: Mango

代码示例1
string[] array = { "cat", "dog", "perl" };

// Use Array.Exists in different ways.
bool a = Array.Exists(array, element => element == "perl");
bool c = Array.Exists(array, element => element.StartsWith("d"));
bool d = Array.Exists(array, element => element.StartsWith("x"));