Comma quibbling: Difference between revisions

Content deleted Content added
Line 159: Line 159:
<lang Mathematica>quibble[words___]:=
<lang Mathematica>quibble[words___]:=
ToString@{StringJoin@@
ToString@{StringJoin@@
Replace[Riffle[{words}, ", "], {prefix___, penult_, ", ", ult_}->{prefix, penult, " and ", ult}]}</lang>
Replace[Riffle[{words}, ", "], {most__, ", ", last_}->{most, " and ", last}]}</lang>
{{out}}
{{out}}
<pre>
<pre>