In built functions

so replace function returns object having the replaced value …so how to know which inbuilt do internally change actual value and which do return value
Do we have to see the documentation for that?

Syntax :

string.replace(old, new, count)

Parameters :

old – old substring you want to replace.
new – new substring which would replace the old substring.
count – the number of times you want to replace the old substring with the new substring. (Optional )

Here is the syntax
I’m not able to understand your question but yeah reading the documentation helps most of the times