Working with strings and array

Hello, well i’m trying to change one specified character from a string and seems like we can;t?

:local string "earth";
:for i from=0 to=([:len $string] - 1) do={
:local char [:pick $string $i];
:if ( $char = "r") do={
 ?? set: ($string->"$i") "s"; ??
}
}

As far as I know the best way to do it would be to

[:pick string 0 r-1] . ‘new character’ . [:pick string r+1]

I don’t believe you can just “replace” that character.

-Eric