Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

ehadam

  • 2 years ago

How do you delete a character in a string? For example, if I wanted to delete x in the string 'erxy'.

  • This Question is Closed
  1. bibby
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 4

    In python you can do something like newstr = oldstr.replace("x", "") to replace ALL occurrences of x in oldstr

  2. zeeporo
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    the original string cannot be changed, strings are immutable.

  3. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy