teststringmodify.py
600 Bytes
# 定义修改函数
def modify_data(x):
# 进行批量修改的逻辑
if x is None:
return x
return x.replace("M{", "").replace("}", "")
# 定义修改函数
def modify_float_data(x):
# 进行批量修改的逻辑
if x is None:
return 0
current = str(x).replace("`", "").replace(' ', '')
if current == '':
return 0
return current
#---------------执行Main----------------
order_code = 'M{202201291647148133}'
order_code = modify_data(order_code);
print(order_code)
order_price = ''
order_p = modify_float_data(order_price)
print(order_p)