0

how can I delete something from a string?

how can I delete "?" from "hello?world" ?

15th Feb 2017, 3:49 PM
Elite
Elite - avatar
2 odpowiedzi
+ 5
Strings are immutable, but not variables... you can simply reaffect a new string value to the same variable ( without "have to create a new string" supposing / meaning a new variable ^^ ): str = "hello?world" str = str.replace("?", " ") print(str)
15th Feb 2017, 5:08 PM
visph
visph - avatar
0
it worked!. thanks
15th Feb 2017, 4:17 PM
Elite
Elite - avatar