Home > Back-end >  Replace/Remove colons of Strings inside a list
Replace/Remove colons of Strings inside a list

Time:06-14

Simple question:

I got following List:

['nordhessen:abfall_b', 'nordhessen:anschlussstelle_b']

And I want to get this List:

['nordhessenabfall_b', 'nordhessenanschlussstelle_b']

How do I remove the colons?

CodePudding user response:

data = ['nordhessen:abfall_b', 'nordhessen:anschlussstelle_b']

new_data = [item.replace(':', '') for item in data]
  • Related