python replace only first instance
'TESTstringTEST'.replace('TEST', 'replaced', 1)
# output 'replacedstringTEST'
3.57
7
text.replace("text", "new", count)
# count is the number of instances you want to replace
Thank you!
7
0
Are there any code examples left?
New code examples in category Python