According to https://www.kamailio.org/wiki/cookbooks/5.1.x/transformations (and I'm using 5.1), I should be able to do something like `$var(num)=$(fU{s.substr,-1,10})` and `$var(num)` should be `123456789` if `$fU` is `0123456789` (only the last 10 characters are displayed). However, `$var(num)` ends up with only the last character of the substring, in this case, `9`.
Closed #1426.
Not sure if the docs are confusing, but the second parameter is the position, which is counted from end backwards when negative value. The length, the third parameter, is always counted forward (never backwards). So if you want to get the last 10 chars:
``` $var(num)=$(fU{s.substr,-10,10}) ```
Feel free to improve the docs.
Thanks @miconda. When you say it that way and I go back to read the docs, they make sense. Sorry for the noise.