Tag: Python: Remove characters from string by regex & 4 other ways
Python: Remove characters from string by regex & 4 other ways
In this article we will discuss different ways to delete single or multiple characters from string in python either by using regex() or translate() or replace() or join() or filter(). Remove characters from string using regex Python’s regex module provides a function sub() i.e. Advertisements re.sub(pattern, repl, string, count=0, flags=0) It returns a new string. …
Python: Remove characters from string by regex & 4 other waysRead More