=begin

### P-roblem

Write a method that takes a single String argument and returns a new string that contains the original value of the argument with the first character of every word capitalized and all other letters lowercase.

# link: https://launchschool.com/exercises/1be5fbac

# input: string
# output: string

## requirements / assumptions

- words are any sequence of non-blank characters

### E-xample

word_cap('four score and seven') == 'Four Score And Seven'
word_cap('the javaScript language') == 'The Javascript Language'
word_cap('this is a "quoted" word') == 'This Is A "quoted" Word'

### D-ata structure



### A-lgorithm

- split string into words
- capitalize each word
- join words

=end

### C-ode

def word_cap(string)
  string.split(' ').map { |word| word.capitalize }.join(' ')
end

p word_cap('four score and seven') == 'Four Score And Seven'
p word_cap('the javaScript language') == 'The Javascript Language'
p word_cap('this is a "quoted" word') == 'This Is A "quoted" Word'
