]A=: ('p';''),:'g';'de'
+-+--+
|p|  |
+-+--+
|g|de|
+-+--+
    ]B=: 'NLB';'LW8';'FW12'
+---+---+----+
|NLB|LW8|FW12|
+---+---+----+
   A <@;@(1&C.)@,"1 0/ B
+------+------+-------+
|pNLB  |pLW8  |pFW12  |
+------+------+-------+
|gNLBde|gLW8de|gFW12de|
+------+------+-------+

Henry Rich 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Sherlock, Ric
> Sent: Thursday, August 30, 2007 7:00 AM
> To: Programming forum
> Subject: RE: [Jprogramming] prefixing and suffixing
> 
> Thanks, looks obvious once I see it!
> I added the ravel to the front to get a simple list.
> prefsuf2=: [:,(>@[EMAIL PROTECTED],],>@{:@[)&.>"0 _ 
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED] 
> > [mailto:[EMAIL PROTECTED] On Behalf Of R.E. Boss
> > Sent: Thursday, 30 August 2007 22:21
> > To: 'Programming forum'
> > Subject: RE: [Jprogramming] prefixing and suffixing
> > 
> >    A (>@[EMAIL PROTECTED],],>@{:@[)&.>"0 _ B
> > +------+------+-------+
> > |pNLB  |pLW8  |pFW12  |
> > +------+------+-------+
> > |gNLBde|gLW8de|gFW12de|
> > +------+------+-------+
> > 
> > or
> > 
> >    B (>@[EMAIL PROTECTED], (,>@{:))&.>"_ 0 A
> > +------+------+-------+
> > |pNLB  |pLW8  |pFW12  |
> > +------+------+-------+
> > |gNLBde|gLW8de|gFW12de|
> > +------+------+-------+
> > 
> > R.E. Boss
> > 
> > 
> > > -----Oorspronkelijk bericht-----
> > > Van: [EMAIL PROTECTED] [mailto:programming- 
> > > [EMAIL PROTECTED] Namens Sherlock, Ric
> > > Verzonden: donderdag 30 augustus 2007 12:11
> > > Aan: Programming forum
> > > Onderwerp: [Jprogramming] prefixing and suffixing
> > > 
> > > I'm not referring to the primitives prefix and suffix, but 
> > to adding a 
> > > prefix and suffix to string.
> > > 
> > > I came up with the monstrosity that is prefsuf below.
> > > I suspect that there are more elegant ways of accomplishing 
> > the same 
> > > thing.
> > > 
> > >    ]B=: 'NLB';'LW8';'FW12'
> > > +---+---+----+
> > > |NLB|LW8|FW12|
> > > +---+---+----+
> > >    ]A=: ('p';'');(<'g';'de')
> > > +----+------+
> > > |+-++|+-+--+|
> > > ||p||||g|de||
> > > |+-++|+-+--+|
> > > +----+------+
> > > NB. Watch line wrapping in email on next line.
> > >    prefsuf=: [: ; [: ; [: ([: {. [ ,&.> ] ,&.> [: {: [)"1 
> > 0&.>/&.> [:
> > > <"1 [ ,/"0 [: < ]
> > > 
> > > 
> > >    A prefsuf B
> > > +----+----+-----+------+------+-------+
> > > |pNLB|pLW8|pFW12|gNLBde|gLW8de|gFW12de|
> > > +----+----+-----+------+------+-------+
> > > 
> > 
> ----------------------------------------------------------------------
> > > For information about J forums see 
> > http://www.jsoftware.com/forums.htm
> > 
> > 
> ----------------------------------------------------------------------
> > For information about J forums see 
> http://www.jsoftware.com/forums.htm
> > 
> ----------------------------------------------------------------------
> For information about J forums see 
> http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to