AnsweredAssumed Answered

Replace Stringparts

Question asked by JB1234510 on May 8, 2020
Latest reply on May 8, 2020 by Davepike101@hotmail.com

Hello,

I have an array looking like this 082640-000-07332/001 and would like to convert it to 0826400000733200100 for a search clause?

I tried this:

sc = line.replace("[", "") # 082640-000-07332/001 convert to 0826400000733200100
sc2 = sc.replace("]", "")

sc21 = sc2.replace("-", "")
sc22 = sc21.replace("/", "")
sc23 = "{}{}".format(sc21, "00")

sc3 = "{} = '{}'".format(field, sc23)
print sc3

but this code results in this (print sc3):

FLURSTUECKSKENNZEICHEN = 'u'08264000007138/000'00'

 

Any help would be great?

Outcomes