Skip to main content
sloth's user avatar
sloth's user avatar
sloth's user avatar
sloth
  • Member for 12 years, 6 months
  • Last seen more than a month ago
awarded
awarded
awarded
awarded
comment
Assembling a user agent descriptor, implemented using StringBuilder vs String
You could also use nested arrays to save some keystrokes, like var data = new[] { new []{"device-type", "mobile"}, ...} and create the string with string.Join(";", data.Select(kvp => string.Join("=", kvp)));. Using KeyValuePair is quite verbose (but also less prone to errors).
awarded
awarded
awarded
awarded
awarded
comment
Single line FizzBuzz solution in LINQ
Well, you could use a SortedDictionary and Last instead of First; but the only advantange over a simple array would be the nice collection initializer syntax instead of using an anonymous type.
awarded
accepted
comment
Idiomatic clojure code in a markdown parser
Thank you very much for your answer. I've written the parser from scratch just to write a parser from scratch and to write some non-trivial clojure code for learning clojure :-)
awarded
revised
Idiomatic clojure code in a markdown parser
added 193 characters in body
Loading…
awarded
asked
Loading…
answered
Loading…
revised
Refactor Linq grouping
added 94 characters in body
Loading…