string - How to remove all characters before a specific character in Python? -


i'd remove characters before designated character or set of characters (for example):

intro = "<>i'm tom." 

now i'd remove <> before i'm (or more specifically, i). suggestions?

use re.sub. match chars upto i replace matched chars i.

re.sub(r'.*i', 'i', stri) 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -