Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save machupicchubeta/10016121 to your computer and use it in GitHub Desktop.
Save machupicchubeta/10016121 to your computer and use it in GitHub Desktop.
convert snake case to camel case in c#
"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);
@shasan-cb
Copy link

Amazing!! works flawlessly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment