1
0
Fork 0
mirror of https://gitlab.com/mfocko/CodeWars.git synced 2024-11-09 11:09:07 +01:00
CodeWars/6kyu/break_camel_case/solution.rb
Matej Focko e394821b7b
6kyu: add break camelCase
Signed-off-by: Matej Focko <mfocko@redhat.com>
2021-12-28 18:16:10 +01:00

9 lines
119 B
Ruby

def solution(string)
string.chars.map { |c|
if c == c.upcase
" " + c
else
c
end
}.join
end