The documentation is kind of misleading. It reads like the function has no return type, and so you might imagine this would work:
s = " fghjh gjh "
RTrim(s)
msg(s)
In fact, it returns a new string, the result of the trimming, so you have t do this:
s = " fghjh gjh "
s = RTrim(s)
msg(s)
or this:
s = " fghjh gjh "
msg(RTrim(s))