How to find the offset of the last instance of a repeating character in a string? (Geoff Canyon)

Mark Wieder ahsoftware at sonic.net
Sun Nov 4 22:11:18 EST 2018


On 11/4/18 6:49 PM, Geoff Canyon via use-livecode wrote:

> I'm not sure I agree that it would be so unlikely to know that overlaps
> won't occur (or that it's unreasonable to not want them). If I'm looking
> for every instance of "romeo" in romeo and juliet, then obviously I'm not
> expecting, nor do I want, overlaps.
Sure, but in that case you'd be better off using the faster 'offset' 
function. Or do you mean every instance of 'romeo' in the play itself? 
There I can see why you'd want to set it to false for speed.

My point isn't really whether pOverlaps should default to true or false, 
but that you need detailed knowledge of the corpus of data before 
calling the function.

If you're looking for 'romeo' in pText, would you set pOverlaps to true 
or to false?

-- 
  Mark Wieder
  ahsoftware at gmail.com




More information about the use-livecode mailing list