[Jprogramming] pwd? tasks.ijs?

Devon McCormick devonmcc at gmail.com
Fri Mar 2 10:56:07 HKT 2007


Oops - sorry  - I've had it so long I've forgotten that it's my own:

replace=: 4 : 0
NB.* replace: replace "from" with "to" in vector y..
   'from to'=. x.
   if. 0~:#str=. ,y. do.
       wh=. 1,}.wh0=. from E. str
       str=. wh <;.1 str
       isin=. ;1 e.&.> (1,}.wh) <;.1 wh0
       str=. (isin*''$$,from)}.&.>str
       str=. ;(isin#&.><to),&.>str
   end.
   str
NB.EG ('xx';<'yow') replace 'xx, this rxxplacement xxx works'
)

though it looks like stringreplace works the same way.

On 3/1/07, Bill Harris <bill_harris at facilitatedsystems.com> wrote:
>
> "Devon McCormick" <devonmcc at gmail.com> writes:
>
> >    NB. where we extend standard replace function:
> > multiReplace=: 4 : 0
> ...
> Pardon my blind spot, but where is the "standard replace function"?  I
> can't find it.  I can find rplc, but that didn't work (neither did
> x. and y., but I changed those, too).
>
> Thanks,
>
> Bill
>
...

-- 
Devon McCormick
^me^ at acm.
org is my
preferred e-mail


More information about the Programming mailing list