On 2/3/07 5:24 AM, "David Bovill" <[EMAIL PROTECTED]> wrote:
>Now I wonder which will be fastest:
>get wordOffset(word1, tText)
>if (it > 0) AND (it = (wordOffset(word2, tText) - 1)) then
>or
>
> put space into P
> put replaceText("once upon a time&q
That is a big difference!
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
put replaceText("once upon a time","\s+",P) into cleanVar
put P&"once upon"&P is in P&cleanVar&P = true
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsub
Thanks guys!
Now I wonder which will be fastest:
get wordOffset(word1, tText)
if (it > 0) AND (it = (wordOffset(word2, tText) - 1)) then
or
put space into P
put replaceText("once upon a time","\s+",P) into cleanVar
put P&"once u
t; <[EMAIL PROTECTED]> wrote:
> put "once upon" is among the words of "once upon a time" = false (which
> surprised me!)
>
> put "once,upon" is among the items of "once,upon,a,time" = true
>
> set the wholeMatches to true
> set th
> put "once upon" is among the words of "once upon a time" = false (which
> surprised me!)
This shouldn't surprise you if you consider:
put "apple,grape" is among the items of "apple,grape,pear" = false
--since "apple,grape" is not an it
If you need exactly two words, how about something like this:
set the wholeMatches to true
get wordOffset(word1, tText)
if (it > 0) AND (it = (wordOffset(word2, tText) - 1)) then
...
end if
It seems wordOffset() will ignore multiple spaces for you.
HTH,
Brian
put "once upon" is among the words of "once upon a time" = false (which
surprised me!)
put "once,upon" is among the items of "once,upon,a,time" = true
set the wholeMatches to true
set the itemDelimiter to space
put "once upon" is among the ite