The replace verb is a utility (can't remember from which library). Been
using it forever, but now it seems broken. Any thoughts?

Kind regards,
Pablo

9!:14 ''

j901/j64/darwin/beta-c/commercial/www.jsoftware.com/2019-04-03T11:20:32

'abcdef' replace 'ab'

|nonce error: replace

| q k}x

replace

4 : 0

'p q'=. y

j=. p nosindx x

if. ''-:j do. x return. end.

d=. p-&#q

k=. (j+(0>.-d)*i.#j)+/i.#q

select. *d

case. 1 do. (0 (j+/(#q)+i.d)}1$~#x) # q k}x

case. 0 do. q k}x

case. _1 do. q k} (0 (d{."1 k)}1$~(#x)+(#j)*|d) #^:_1 x

end.

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

Reply via email to