I did not write stringreplace, so am not prepared to discuss its
implementation tradeoffs.

But, yes, this works:

   r=: ,   LF,.~":   _7 ]\ 0 >. i.&.(+&5) 32
   r
 0  0  0  0  0  0  1
 2  3  4  5  6  7  8
 9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31  0  0  0  0  0
   r rplc ' 0';'  '
                   1
 2  3  4  5  6  7  8
 9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31

Thanks,

-- 
Raul

On Thu, Sep 28, 2017 at 9:21 AM, Rudolf Sykora <[email protected]> wrote:
> On 28 September 2017 at 14:50, Raul Miller <[email protected]> wrote:
>> Another way to work around this problem would be to use stringreplace"1
>>
>>    r=: _7 ]\ 0 >. i.&.(+&5) 32
>>    (":r) rplc"1 ' 0';'  '
>
> Ok. Thanks. So is there a good reason for txt=. ,y in stringreplace?
>
> Or, can the whole of r be represented as just a (single) list of characters,
> like
>
>     a =. 0 : 0
>  1 0 3
>  0 4 5
> )
>
>     a
>  1 0 3
>  0 4 5
>
>     $a
> 14
>
>     a rplc ' 0';' '
> 1   3
>   4 5
>
> i.e., here the rplc can be used directly...
>
> Thanks
> Ruda
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to