KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have some sample string. How can I replace first occurrence of this string in a longer string with empty string? regex = re.compile('text') match = regex.match(url) if match: url = url.replace(regex, '')
Tags (comma-separated)
Save Edits
Cancel