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 -

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

c# - Search and Add Comment with OpenXML for Word -