in reply to Re: Creating comma-delimited lists
in thread Creating comma-delimited lists

This is the easy way, but it ignores the requirement to print "and" before the last known item. You would print "I know about this,that,the other,the last thing.", not "I know about this, that, the other, and the last thing.".

Replies are listed 'Best First'.
RE: RE: Re: Creating comma-delimited lists
by mrmick (Curate) on Aug 25, 2000 at 16:49 UTC
    It FIGURES that I would overlook that. Thank you, BlaisePascal, for spotting it. It's nice comments like yours that will help to keep me on my toes. :-)

    Well, in an attempt to redeem myself, here's an oversimplified (and crude)fix:

    @a = ('this', 'that', 'the other', 'the last thing'); $lastone=pop(@a); $tmpstring=join(',',@a); $string = "I know about $tmpstring, and $lastone."; print $string;

    Mick