Skip to content

Instantly share code, notes, and snippets.

@qittu
Last active January 14, 2016 01:33
Show Gist options
  • Save qittu/6028228 to your computer and use it in GitHub Desktop.
Save qittu/6028228 to your computer and use it in GitHub Desktop.
Camelize in C#
/*
* Ex.
* Convert "foo_bar" to "FooBar".
*/
public static string camelize(string str) {
string result = "";
string[] strArray = str.Split('_');
foreach(string word in strArray) {
result += word.Substring(0, 1).ToUpper() + word.Substring(1);
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment