If I have the following line:
string s = "abcdefghab";
Then, how do I get a string (or char []) that only has characters that are repeated in the original string using C # and LINQ. In my example, I want to end with "ab".
Although not required, I tried to do this on a single LINQ line and still came up with:
s.ToCharArray().OrderBy(a => a)...
source
share