0

So I am having a weird issue here When I am stripping a certain string which have parenthesis, its removing the first word after the parenthesis Ex:

c = 'PurchaseOrderItem(d330d1adf0)'
print (c.strip("PurchaseOrderItem("+")"))

OUTPUT : 330d1adf0

the above output should have the char 'd', but its removing it

Cow
  • 2,543
  • 4
  • 13
  • 25
  • See the [docs](https://docs.python.org/3/library/stdtypes.html#str.strip) it's clearly explained. *The chars argument is not a prefix or suffix; rather, all combinations of its values are stripped:* – Abdul Niyas P M Jan 09 '23 at 11:18
  • To achieve your desired output, consider [`replace()`](https://docs.python.org/3/library/stdtypes.html#str.replace) function like `c.replace("PurchaseOrderItem(",'').replace(")",'')` – hc_dev Jan 09 '23 at 11:23

0 Answers0