Summary:ASTERISK-15892: When providing a delemeter character, placing it betwenn apostrophy signs does not work. CUT retruns the shole string in this ca
Reporter:roland65 (roland65)Labels:
Date Opened:2010-03-30 07:04:07Date Closed:2010-04-28 16:11:21
Versions:Frequency of
Description:The following example fails:
exten => 123,1,Set(foo=1 2 3 4 5)
exten => 123,n,Set(foo=${CUT(foo,' ',2)})

which means that instead of returning the second space separated field, CUT returns the whole string.

A work-around is to replace the ' apostrophy sign by double quotes like:

exten => 123,1,Set(foo=1 2 3 4 5)
exten => 123,n,Set(foo=${CUT(foo," ",2)})

This correctly returns 2.
Comments:By: Tilghman Lesher (tilghman) 2010-03-30 09:59:21

Nowhere is it documented that placing the delimiter between apostrophe signs will do what you want.  In fact, the suggested method in the documentation is to use the backslash character to specify the character in hexadecimal or octal.

By: Tilghman Lesher (tilghman) 2010-03-30 10:00:17

In fact, what you've done here is to specify the delimiter as the apostrophe.

By: Paul Belanger (pabelanger) 2010-04-28 16:11:21

As Tilghman reported, this does not appear to be an issue.  And will be closing as a result.