[Jprogramming] append string to a list of strings?
Randy MacDonald
ramacd at nbnet.nb.ca
Wed Jul 23 00:45:58 HKT 2008
Hello Tom;
Note that ,&'cc' each list gives 'aacc';'bbcc';'randomdatacc'
This also works:
(<'cc'),each list NB. make sure the boxing levels match.
Tom Arneson wrote:
> ,&'cc' each list
>
> Bond combines , and 'cc' into a new verb
>
> -----Original Message-----
> From: programming-bounces at jsoftware.com
> [mailto:programming-bounces at jsoftware.com] On Behalf Of unigee
> Sent: Sunday, July 20, 2008 13:20
> To: programming at jsoftware.com
> Subject: [Jprogramming] append string to a list of strings?
>
>
> hi, im learning myself J and come into a slight problem I don't know how to
> solve
>
> im trying to append some characters to a list of strings
>
> list=. 'aa' ; 'bbb' ; 'randomdata'
>
> now i want to add 'cc' to each item in list, so the result would be
> 'ccaa' 'ccbbb' 'ccrandomdata'
>
> I thought this would be it
> 'cc' , each list
>
> but that produces an length error
>
> can someone please point me in the right direction?
>
--
------------------------------------------------------------------------
|\/| Randy A MacDonald | APL: If you can say it, it's done.. (ram)
|/\| ramacd <at> nbnet.nb.ca |
|\ | | The only real problem with APL is that
BSc(Math) UNBF'83 | it is "still ahead of its time."
Sapere Aude | - Morten Kromberg
Natural Born APL'er |
-----------------------------------------------------(INTP)----{ gnat }-
More information about the Programming
mailing list