Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Title
- def initialize(string)
- @string = string
- end
- def fix
- string_array = @string.split(" ")
- string_array.map do |word|
- word.downcase!
- unless word.include?("of") || word.include?("and") || word.include?("the")
- word.capitalize!
- end
- end
- string_array.join(" ")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement