strip substring code example
Example 1: python strip
txt = " test "
txt.strip()
#Output: "test"
txt.lstrip()
#Output: "test "
txt.rstrip()
#Output: " test"
Example 2: remove a part of a string python
url = 'abcdc.com'
print(url.replace('.com',''))