Thank you for the new page on wiki:
http://www.jsoftware.com/jwiki/Essays/Substring_Replacement
The final step is to implement multiple replacements with the same verb, so
we'll have a true equivalent of rplc in strings.ijs library.
Lorenzo Tomei
Roger Hui wrote:
>
> replace=: 4 : 0
> 'p q'=. y
> j=. p [EMAIL PROTECTED] x
> if. ''-:j do. x return. end.
> select. *d=. p -&# q
> case. 1 do. (0 (j+/q(}.i.)&#p)}1$~#x) # q (j +/ i.#q)}x
> case. 0 do. q (j +/ i.#p)}x
> case. _1 do. q k} (0 (d{."1 k)}1$~(#x)+(#j)*|d) #^:_1 x [ k=.
> (j+(|d)*i.#j)+/i.#q
> end.
> )
>
>
--
View this message in context:
http://www.nabble.com/tacit-stringreplace-tp20476004s24193p20495837.html
Sent from the J Programming mailing list archive at Nabble.com.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm