mirror of
https://gitlab.com/mfocko/CodeWars.git
synced 2024-07-26 23:01:07 +02:00
6kyu: add break camelCase
Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
parent
3fc8a805ef
commit
e394821b7b
9
6kyu/break_camel_case/solution.rb
Normal file
9
6kyu/break_camel_case/solution.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
def solution(string)
|
||||
string.chars.map { |c|
|
||||
if c == c.upcase
|
||||
" " + c
|
||||
else
|
||||
c
|
||||
end
|
||||
}.join
|
||||
end
|
Loading…
Reference in a new issue