re: Daily Challenge #34 - WeIrD StRiNg CaSe VIEW POST

TOP OF THREAD FULL DISCUSSION
re: def to_weird_case(s) s.split(' ').map { @1.chars.map.with_index { @2.even? ? @1.upcase : @1.downcase }.join }.join(' ') end
 

Ah I tried map_with_index but that's not a method. Did not know there was a .map.with_index!

 

I'm glad to hear that. Enumerable has so many methods, which is useful but I take a little bit time to remember them.

code of conduct - report abuse