I have created the following code:
def LetterCapitalize(str)
str = str.split(" ").each {|word| word.capitalize!}
str = str.join(" ")
return str
end
This takes in a basic string and capitalizes the first letter of all of the words. It looks kind of awkward to reassign things to "str"str
twice. What is wrong with my style here, if anything at all?