string[] arr = { "abcdefXXX872358", "abcdef200X8XXX58", "abcdef200X872359", "6T1XXXXXXXXXXXX11", "7AbcdeHA30XXX541", "7AbcdeHA30XXX691" };
how can I get distinct no from above where first 6 charatcer must be distinct result would be
abcdefXXX872358
6T1XXXXXXXXXXXX11
7AbcdeHA30XXX541
I try something like this
var dist = (from c in arr select c).Select(a => a.Substring(0, 5)).Distinct(); which gives me first 5 character but I want whole string