A
A
Azimia Reg2020-02-08 20:13:32
C++ / C#
Azimia Reg, 2020-02-08 20:13:32

How to get a repeating character?

For example, from renege the letter e .
Can linq do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
breathtaking, 2020-02-09
@Azimia

So get all duplicate characters:

var duplicates = str.GroupBy(x => x)
    .Where(x => x.Count() > 1)
    .Select(x => x.Key);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question