3 ms·
Same. Don't know Ruby at all, but in this case the language is pretty straightforward. Perhaps Ruby was the wrong example. Let's get more magical with Perl:
by peterwwillis 11y ago
Same. Don't know Ruby at all, but in this case the language is pretty straightforward. Perhaps Ruby was the wrong example. Let's get more magical with Perl:
map s {(\w+)} {\u$1}g, @sentence;
I'll give a dollar to anyone who already knows Perl and can tell me what the fuck is going on there.
- chromatic 11y agoIn rough English, it uppercases the first letter every word in every element of the sentence array.