-5

I'm making an odoo10 module, but I need to change a string like

000-000

to

000000

How can I do that?

halfer
  • 19,824
  • 17
  • 99
  • 186
GioV
  • 17
  • 11

2 Answers2

0
print("000-000".replace("-", "")) #Output: "000000"
Flaming_Dorito
  • 486
  • 3
  • 11
-1

Try this

Oldstr = “000-000”
Newstr = Oldstr.replace(“-”,””)

That should do it. What I did:

  1. Make the string “000-000”
  2. Made a new string and replaced the “- ”in the old one with nothing and saved it in a new variable