Devon wrote:
> ('AA';'B') stringreplace 'AAA'
>BA
> ('AA';'B') replace 'AAA'
>BB
>Does anyone have a thought to which behavior is "correct"
>or at least better?
Most implementations of string replace functions have the former behavior.
The latter may have applications, but would come as a surprise to most users,
who would replace to act like Find/Replace in a text editor, where the Nth
"find" occurs strictly after the N-1th "replace".
See also Roger's recent contribution at
http://www.jsoftware.com/jwiki/Essays/Non-Overlapping_Substrings
-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm