Contains vs is in

Richard Gaskin ambassador at fourthworld.com
Mon Jan 2 21:49:48 CET 2017


Mark Talluto wrote:

 >> On Dec 30, 2016, at 2:32 PM, J. Landman Gay wrote:
 >>
 >> Did someone once say that between "contains" and "is in",
 >> one is faster than the other?
 >
 > This is a great question. One of the engineers on the LC team would
 > be needed to answer this one.

Or you could test it:

on mouseUp
    put 1000000 into n

    put the millisecs into t
    repeat n
       put ("this is a string with foo in it" contains "foo") into r2
    end repeat
    put the millisecs - t into t2

    put the millisecs into t
    repeat n
       put ("foo" is in "this is a string with foo in it") into r1
    end repeat
    put the millisecs - t into t1

    put t1 && t2
end mouseUp

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com



More information about the use-livecode mailing list