How to find the offset of the last instance of a repeating character in a string?

Bob Sneidar bobsneidar at iotecdigital.com
Mon Oct 29 18:55:57 EDT 2018


That will only give him the item, not the character position. But it's a start. You can now get the number of characters of item 1 to -2 of pText +1. I didn't know the text you were searching had regular delimiters, and you were searching for the last delimiter. That makes things *much* easier. 

Bob S


> On Oct 29, 2018, at 15:32 , Mark Wieder via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> On 10/29/2018 08:32 AM, Keith Clarke via use-livecode wrote:
> 
>> I’m trying to separate paths & pages from a list of URLs and so looking to identify the position of the last ‘/‘ character.
> 
> function rightmostSlashOf pText
>   set the itemdelimiter to "/"
>   return offset(item -1 of pText, pText)
> end rightmostSlashOf
> 
> -- 
> Mark Wieder
> ahsoftware at gmail.com
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list