Skip to content

Instantly share code, notes, and snippets.

@primitive-type
Created March 24, 2017 19:22
Show Gist options
  • Save primitive-type/c6fa4fcaa2a0e52839b5cf79c44ba27b to your computer and use it in GitHub Desktop.
Save primitive-type/c6fa4fcaa2a0e52839b5cf79c44ba27b to your computer and use it in GitHub Desktop.
Convert Snake Case to Start Case
def snake_case_to_start_case(snake_case) do
snake_case
|> String.replace("_", " ")
|> String.split
|> Enum.map(&String.capitalize(&1))
|> Enum.join(" ")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment