Skip to content

Instantly share code, notes, and snippets.

Created April 25, 2015 05:18
Show Gist options
  • Save anonymous/cd606366817fb2937c42 to your computer and use it in GitHub Desktop.
Save anonymous/cd606366817fb2937c42 to your computer and use it in GitHub Desktop.
def capitalize_words(string)
i=0
result = ""
for el in string.split(" ")
string[el] = string[el].capitalize
puts string[el]
puts el
end
return string
end
puts capitalize_words "this is a sentence"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment