Created
March 24, 2017 19:22
-
-
Save primitive-type/c6fa4fcaa2a0e52839b5cf79c44ba27b to your computer and use it in GitHub Desktop.
Convert Snake Case to Start Case
This file contains 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
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