Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ここですでに尋ねられた質問の延長があります
ただし、元の文字列の再帰文字の最長セットのリストを返したいのですが、char とその相対カウントのリストではなく、最も高い順に並べたものです。
私はリンクにかなり精通していましたが、文字列内の char 型を照会するインスタンスに遭遇したことがなく、LINQ の特定のユースケースを理解するのに役立つヒントを誰かが教えてくれると思いました...
ありがとう
リンクされた例を使用:
var largest = input.GroupBy(x => x).OrderByDescending(x => x.Count()).First(); var asString = new string(largest.Key, largest.Count());