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

gcc - MinGW's ld cannot perform PE operations on non PE output file -

How to connect android app to App engine -

hadoop - Running Map Reduce Job shows error - Mkdirs failed to create /var/folders/ -