sTest = '1/0/2'
if sTest.count('/') == 2:
    sTest = sTest.replace('/0/', '/1/')
elif sTest.count('/') == 1:
    sTest = sTest.replace('/', '/1/')
else:
    print('Error: Test string is of an unknown format.')
Matching character "/" in a string