我有一个数组
{
Line.Column1.Pos,
Line.Column1.Length,
Line.Column2.Value,
Line.Column3.Pos,
Line.Column3.Length,
line.Column5.Date
}
如何获取unque子串列表,即
Linq {Column1,Column2,Column3,Column5 }
答案 0 :(得分:1)
如果你能得到数组中项目的字符串表示,
你可以这样做:
string[] items =
{
"Line.Column1.Pos",
"Line.Column1.Length",
"Line.Column2.Value",
"Line.Column3.Pos",
"Line.Column3.Length",
"line.Column5.Date"
};
var distinctItems = items.
Select(o => o.Split('.')[1]).
Distinct().
ToArray();