[lang-ref] ( replace_first ) ( python )
def test_replace_first():
# s.replace(before, after, 1)
text_org = 'abc def ghi\nabc def ghi'
s_org = 'def'
s_new = '!!DEF!!'
text_new = text_org.replace(s_org, s_new, 1)
assert text_new == 'abc !!DEF!! ghi\nabc def ghi'