Friends,
Could you please tell me the syntax of this below
Array={1,2,3,1,2,3}
the O/p should be unique values of the array.
Friends,
Could you please tell me the syntax of this below
Array={1,2,3,1,2,3}
the O/p should be unique values of the array.
Are you loooking for this?
Yea Peter, its Array on Int
Array={1,2,3,1,2,3} line is initializing an int array with different values
When it is done manually then go for
Array={1,2,3}
or use the Distinct on already populated array
you mean to say …
arr={1,2,3,1,2,3}
arr.Distinct(arr).ToArray()
…?
lets assume you have an array arrInt with the values 1,2,3,1,2,3
then arrInt.Distinct().toarray will return the distinct, non duplicated values
more clear?
or do I need to iterate ?
we have to do following for displaying it in th message box (getting string representation)
String.Join(“,”,arrInt.Distinct().toarray)
But it is more preferable to debug and using locals / watch / immediate panel
thank you Peter
Thanks for giving fast response
perfect when it is solved please mark the solving post solution. So others can benefit from it. Thanks
done
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.