On Fri, Jul 21, 2023 at 4:10 PM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Out of curiosity, what can be done in in Python that cannot be done in LC
> Script?
>

I'm learning more as I study python. This is pretty nice:

import re
x = re.split('[a|t]','this is a test and this is another')
print(x)

['', 'his is ', ' ', 'es', ' ', 'nd ', 'his is ', 'no', 'her']

Or if you want the dividers as well:

import re
x = re.split('([a|t])','this is a test and this is another')
print(x)

['', 't', 'his is ', 'a', ' ', 't', 'es', 't', ' ', 'a', 'nd ', 't', 'his
is ', 'a', 'no', 't', 'her']
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to