Hello, it is me again I"m making progress with my first app, but I got stuck on a simple issue, I'm sure it is just me being lame, but I seem not able to figure it out:

I need to replace some characters in my string, for example "2" with "3", when I use it like this it works and it displays "test 3":

Page {

property string variable: "test 2"

Text {
text: variable.replace("2","3")
}

}

But when I use it in function like this, it still shows "test 2"

Page {

function textreplace(tmptext) {


tmptext.replace("2","3")
return tmptext;

}

property string variable: "test 2"

Text {
text: textreplace(variable)
}

}

I really don't know what is wrong? Thank you for every opinion.