--bill lam wrote:
> Sherlock, Ric wrote:
> > My solutions as follows:
> >    textend=: {:@$&.>@[ {."1&.> ]
> >    pplinv textend pinv
> > +-------+------+
> > |Joan   |Saxon |
> > +-------+------+
> > 
> >    pplinv tindexof pplinv textend pinv
> > 4
> > 
> 
> A potential gotcha is that text in pinv is longer than 
> pplinv, your solution will trim pinv to shorter length but 
> there should not be any match because pinv is longer than 
> pplinv.  Of course if it is known before hand that pinv must 
> be shorter than pplinv, there will be no problem.

Very true! 
This certainly makes Chris' suggestion a safer bet for the general case.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to