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?

2nd Sep 2017, 9:53 PM
Rhesus
Rhesus - avatar
3 odpowiedzi
3rd Sep 2017, 6:29 AM
༼ つ ◕_◕ ༽つ
༼ つ ◕_◕ ༽つ - avatar
+ 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)
2nd Sep 2017, 10:05 PM
Dapper Mink
Dapper Mink - avatar
+ 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
2nd Sep 2017, 9:55 PM
Michael Vigato
Michael Vigato - avatar