0
How can I remove or change some determinated characters in a string?
For example, if I have this string "En un lugar de la Mancha...", and I want to replace all the vowels, or I want to remove all the "e", how can I do it?
3 Antworten
+ 3
txt = "Blabla this is a random text"
txt2 = ""
for i in range(len(txt)):
if txt[i] == "i":
txt2 += "quot;
else:
txt2 += txt[i]
print(txt2)
+ 2
doesn't Python have a library of functions for modifying Strings?
you might want to use them as lists and do it with, like, a for each