Gsub issues i dont understand

Hello, I have a problem with gsub, could someone explain to me what exactly it does, please? :frowning:

    a = "one string"
    b = string.gsub(a, "one", "another")  -- change string parts
    print(a)       --> one string
    print(b)       --> another string

It just replaces something in the string with something else, in this case it replaces “one” with “another”.

1 Like