On Sep 27, 2014, at 12:23 AM, JB <[email protected]> wrote:
> But there might be a faster way.
Hi, John.
Here's a way that works in under a millisecond on my iMac, and a way to test
its speed.
command replace_maybe @rString
repeat with i = 3 to length( rString ) step 3
if char i of rString is "D" then
put "+" into char i of rString
end if
end repeat
end replace_maybe
on mouseUp
local tString, tMilliseconds
repeat 1000 -- strings
put empty into tString
repeat 10000 -- characters
put any char of "abcdef" after tString
end repeat
subtract the long milliseconds from tMilliseconds
replace_maybe tString
add the long milliseconds to tMilliseconds
end repeat
answer "milliseconds per string:" && tMilliseconds / 1000
end mouseUp
How's that, John?
-- Dick
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode