RM=Raul Miller, DB=me

RM>  It becomes more interesting when comparing
RM>  text in character arrays (where trailing 
RM>  spaces are often irrelevant).

DB>        is =:  i.&s:
DB>        tb =:  i.&:(<@dtb"1)
DB>        
DB>        ts 'X is Y'
DB>     0.0598878 2.1063e6
DB>        ts 'X tb Y'
DB>     5.77107 6.03786e7

Hey, what do you know:

DB>   r  =:  0>.(#$X)-1
DB>   Z  =.  (}.$ X) {."r Y
DB>   X i. Z

           ri =:  4 : 'x i. (}.$ x) {."(0>.(#$x)-1) y'
           
           X ri Y
        3 0
           
           ts 'X ri Y'
        0.0161384 4.2055e6
              
Fastest yet.

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

Reply via email to