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

Reply via email to