Error running script: Function not found: 'RTrim'

Korpsian
05 Jun 2016, 13:10
Trying to call this function which i found in the documentation of Quest but i only get the massage that the function not exists.

I included the Core library. Any ideas?

The Pixie
05 Jun 2016, 14:13
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))

Korpsian
05 Jun 2016, 14:26
oh ok now i got it. thx for the help... ok that helps for this problem.

But now i want to trim down letters or numbers from a string which is not possible with this U.U is there also a way to do this?

The Pixie
05 Jun 2016, 17:58
You can always iterate through the string, handling each character in turn.
for (i, 1, LengthOf(s)) {
c = Mid(s, i, 1)
// Do stuff with c
}

Korpsian
05 Jun 2016, 19:21
thank you!