📜  c# 查找字符串数组中最小的字符串 - C# 代码示例

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

代码示例1
string[] names = new string[3]{
     "Tom", "and", "jerry"
};

string minValue = names[0];
foreach (string name in names)
{
     if (name.Length < minValue.Length)
     {
          minValue = name;
     }
}

Console.WriteLine(minValue);