Skip to content

Instantly share code, notes, and snippets.

@yoyama
Last active November 24, 2016 06:30
Show Gist options
  • Save yoyama/09f03cce37983a802afb390ad1c8041f to your computer and use it in GitHub Desktop.
Save yoyama/09f03cce37983a802afb390ad1c8041f to your computer and use it in GitHub Desktop.
snake2camel
def snake2camel(s:String):String = s.toList.foldLeft(List.empty[Char]){
case ('_'::xs, c) => c.toUpper::xs
case (xs, c) => c::xs
}.reverse.mkString("")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment