What is Nostr?
Al Sweigart /
npub138a…88z7
2024-07-17 16:05:03

Al Sweigart on Nostr: I need to borrow Guido's time machine and add `before()` and `after()` str methods to ...

I need to borrow Guido's time machine and add `before()` and `after()` str methods to Python:

>>> def before(s, q):
... return s[:s.find(q)]
...
>>> def after(s, q):
... return s[s.find(q) + len(q):]
...
>>> before('foobar', 'bar')
'foo'
>>> after('foobar', 'foob')
'ar'
Author Public Key
npub138afdyyaxs7ta0ugnuf3jt3swxtz83gsywf5grg465w5ktqg7z2qds88z7