repl.it
@anonymous/

UnwelcomeSilentAlbino

Ruby

No description

fork
loading
Files
  • main.rb
main.rb
1
2
3
4
f=->w,s{s.gsub(/\w/){|c|w=~/\b#{c}(\w+)/i;c+($1||c)[1..-1]}}

puts f["no pro gr am m ing", "People think bananas are great, don't you?"]
puts f["no pro gr am m ing", "Google Wikipedia"]
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]