Created
December 5, 2016 03:01
-
-
Save TheSecretSquad/ff4e0799e616091d340bff29f0c9ce04 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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