c# program to remove duplicate elements from a given integer using linq? -
it should using linq only.for example if integer 123444 taken,then should print 1234. unable single integer.i can list of integers.
you can converting int string , getting digits in array. applying distinct remove duplicates array. once have array of unique digit can make string using join. parsing string int give number duplicate digits in it.
int j = int.parse(string.join("",i.tostring().toarray().distinct()));
Comments
Post a Comment