Comma quibbling: Difference between revisions
Content deleted Content added
→{{header|Tcl}}: As a one-liner (awesome!) |
→{{header|Perl}}: missing spaces |
||
Line 162: | Line 162: | ||
return "{$_}" for |
return "{$_}" for |
||
@_ < 3 ? join(' and ', @A) : |
@_ < 3 ? join(' and ', @A) : |
||
join(',', @A[0..@A-2]) . ' and ' . $A[-1]; |
join(', ', @A[0..@A-2]) . ' and ' . $A[-1]; |
||
} |
} |
||
Line 171: | Line 171: | ||
{ABC} |
{ABC} |
||
{ABC and DEF} |
{ABC and DEF} |
||
{ABC,DEF,G and H}</pre> |
{ABC, DEF, G and H}</pre> |
||
=={{header|Perl 6}}== |
=={{header|Perl 6}}== |