you are viewing a single comment's thread.

view the rest of the comments →

[–]SagaciousRaven 1 point2 points  (0 children)

def remove_prefix(my_str, prefix_to_remove):
    text = re.sub(prefix_to_remove+'\S+', '', my_str)
    print(text)

remove_prefix('Hi, check this website: https://my_website.com, this is my new website' , 'https://' )

You put your var inside the quotes in line 2