Re: question on func equal_from
- Posted by c.k.lester <euphoric at ckles?er.com> Jul 26, 2007
- 693 views
Salix wrote: > > constant tx="very long sequence" > > for i=1 to length(tx) by 1 do > if i>7 and equal("https://",tx[i-7..i]) then > -- do something > elsif i>6 and equal("http://",tx[i-7..i]) then > -- do something > elsif i>5 and equal("ftp://",tx[i-7..i]) then > -- do something > end if > end for I admit I don't know what your data looks like, but that seems too complicated and inefficient. why not do something like this:
i = match("https://",tx) if i = 7 then elsif i = 6 then elsif i = 5 then end if