1 2 3 4 5 6 7 8 9
str = "AbcEdfGhi" b="" "CamelCase".split('').each{|i| if i.downcase! b += "_" end b += i } p b
1
"_camel_case"