[sr-dev] [kamailio/kamailio] s.substr transformation with negative offset and length greater than 1 not working (#1426)

Daniel-Constantin Mierla notifications at github.com
Sun Feb 4 07:58:21 CET 2018


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.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1426#issuecomment-362885657
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20180203/a8d07b0b/attachment.html>


More information about the sr-dev mailing list