def proper_name_casing(name) name.each_with_index do |l, i| l.upcase! if i == 0 if l == " " or l == "'" or l == "-" upcase = true next end if upcase = true l.upcase! upcase = false end end end proper_name_casing "bUCky o'shEa"