-3

I have str1: "I can\'t do that." How can I get from str1 to str2: "I can't do that."?

I have tried str2 = str1.replace("\", "") but it doesn't work.

Thank you!

jo_
  • 677
  • 2
  • 11

1 Answers1

1

Try this:

str1.replace("\\", "")
dimay
  • 2,768
  • 1
  • 13
  • 22