【发布时间】:2018-01-11 11:11:29
【问题描述】:
我正在搜索一个数组并尝试查找对象描述。我遇到的问题是尝试使用通配符。如何在我的数组中搜索以“描述:”开头的值。
int[] poss = textlist.Select((b, i) => b == "Description:*" ? i : -1).Where(i => i != -1).ToArray();
string[] Description = new string[poss.Length - 1];
foreach (int pos in poss)
{
Description = textlist[pos];
}
【问题讨论】:
-
b.Contains("Description") -
或
b.StartsWith( "Description:" )
标签: c# arrays string search wildcard