For what need i "count" in replace comment?

Hello,

I have script running well. in the tutorial is written to use a count number? for what ? i set any number nothing happend, but when i don`t use it, the script is not working!

strings = IN[0]
old = IN[1]
new = IN[2]

OUT = []

for i in strings:
    i = i.replace(old,new,1)          #what does the integer do?
    OUT.append(i)

It is the max variable:

3 Likes

That’s for when you have multiple times the same string inside a string, that specifies how much times you want to replace it.

Edit: @Anton_Huizinga beat me to it :smiley:

3 Likes