Skip to content

Instantly share code, notes, and snippets.

@TheSecretSquad
Created December 5, 2016 03:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheSecretSquad/ff4e0799e616091d340bff29f0c9ce04 to your computer and use it in GitHub Desktop.
Save TheSecretSquad/ff4e0799e616091d340bff29f0c9ce04 to your computer and use it in GitHub Desktop.
// Inefficient, but interesting "string to title case" implementation using Linq.
"some text"
.Split(' ')
.Select(word => char.ToUpper(word[0]) + word.Remove(0, 1).ToLower())
.Aggregate((result, nextValue) => result + ' ' + nextValue);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment