Finding in reverse

Klaus Major klaus at major-k.de
Wed Jul 5 13:55:55 EDT 2006


Hi Ken,

> On 7/5/06 10:55 AM, "Robert Sneidar" <bobs at twft.com> wrote:
>
>> Is there a way to scan a text string from end to beginning for
>> something without using a loop? I am trying to "be binary" (for those
>> of you conference goers) and I am trying to extract just a file's
>> name from the full path. It seems to be something of a difficult
>> thing to do in a one liner.
>
> How about this for a one-liner (that doesn't cheat <grin>):
>
>   put line -1 of replaceText(myFilePath,"/",CR)
>
> :-)

HA!

I KNEW you would pull some magic "regex"-stuff out of your sleeve :-)

> Ken Ray
> Sons of Thunder Software
> Web site: http://www.sonsothunder.com/
> Email: kray at sonsothunder.com

Regards

Klaus Major
klaus at major-k.de
http://www.major-k.de




More information about the use-livecode mailing list