Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Since most other popular languages seem represented:

        string SortedKeyList<T, U>(params IDictionary<T, U>[] maps)
        {
            var keys = new SortedSet<string>(maps.SelectMany(m => m.Keys)
                                                 .Select(k => k.ToString()));
            return keys.Any() ? String.Join(", ", keys) : "<none>";
        }
EDIT: I just realized that a lot of curly brace languages look the same to the uninitiated. The above is C#.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: