INPUT:
s = 'Coated tablet + ALFUZOSIN HYDROCHLORIDE, Film-coated tablet + ALFUZOSIN HYDROCHLORIDE, Modified-release tablet + ALFUZOSIN HYDROCHLORIDE, Prolonged-release tablet + ALFUZOSIN HYDROCHLORIDE'
EXPECTED OUTPUT:
s = 'Coated tablet, Film-coated tablet, Modified-release tablet, Prolonged-release tablet'
For each string like this, how do I get the necessary output in Python so that all elements after the + doesn't come.
Do split on ,
and then on +
and fetch item at index 0
', '.join([i.split("+")[0].strip() for i in s.split(",")])
Output
'Coated tablet, Film-coated tablet, Modified-release tablet, Prolonged-release tablet'