Created
March 4, 2016 11:07
-
-
Save Saanch/5685b99340f3e3b98bc1 to your computer and use it in GitHub Desktop.
convert snake_case to camelCase in c#
This file contains hidden or 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
"foo_bar".Split(new[] { "_" }, StringSplitOptions.RemoveEmptyEntries).Select(s => char.ToUpperInvariant(s[0]) + s.Substring(1, s.Length - 1)).Aggregate(string.Empty, (s1, s2) => s1 + s2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment