说我有此数组: MYARRAY(0)=AAA MYARRAY(1)=BBB MYARRAY(2)=AAA
Say I've got this array: MyArray(0)="aaa" MyArray(1)="bbb" MyArray(2)="aaa"
有一个.NET函数,它可以给我的唯一值?我想这样的事情作为函数的输出: OutputArray(0)=AAA OutputArray(1)=BBB
Is there a .net function which can give me the unique values? I would like something like this as an output of the function: OutputArray(0)="aaa" OutputArray(1)="bbb"
假设你有净3.5 / LINQ:
Assuming you have .Net 3.5/LINQ:
string[] OutputArray = MyArray.Distinct().ToArray();