rplc is interesting, but it is a little of
an overkill if you consider it's source, and
it is for ranges rather than atoms.

   tr=: ({:@[,]) {~ ([EMAIL PROTECTED],]) i. ]
   
   ('';' ') ;@tr text
the yellow cat is sleeping

   (('';'the'),:' ';'a') ;@tr text
a yellow cat is sleeping


Another possibility

   swap=: 1 : '[`(I.@(x&=)@])`]}'
   ; (<' ') a: swap text
the yellow cat is sleeping


And finally,

   ;(' '"_)^:(0=#)&.> text
the yellow cat is sleeping


--- Raul Miller <[EMAIL PROTECTED]> wrote:

> On Dec 1, 2007 10:49 PM, June Kim <[EMAIL PROTECTED]> wrote:
> >   ; text rplc (a:);<<' '
> > the yellow cat is sleeping
> 
>    ; text rplc (a:);<<' '
> |value error: rplc
> |   ;text     rplc(a:);<<' '
>    ; text rplc (a:);<<' ' [require'strings'
> the yellow cat is sleeping



      
____________________________________________________________________________________
Get easy, one-click access to your favorites. 
Make Yahoo! your homepage.
http://www.yahoo.com/r/hs 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to