Hello,
how can I cut off the last character of the EXTEN-variable with
variating length ?
So I have :
112233#
123#
123456789#
I want to cut off the last character.
${EXTEN:-1} gives me #, but that is the character I want to cut off.
Kind regards,
Jonas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.digium.com/pipermail/asterisk-users/attachments/20130820/1955fb04/attachment.htm>
On 20/08/13 09:29, Jonas Kellens wrote:> Hello, > > how can I cut off the last character of the EXTEN-variable with > variating length ? > > So I have : > > 112233# > 123# > 123456789# > > I want to cut off the last character. > > ${EXTEN:-1} gives me #, but that is the character I want to cut off.Set(variable=${EXTEN:0:$[LEN(${EXTEN})-1]}) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20130820/2474c16c/attachment.htm>
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Jonas Kellens
Sent: Tuesday, August 20, 2013 4:29 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] Cut off last character of EXTEN
Hello,
how can I cut off the last character of the EXTEN-variable with variating
length ?
So I have :
112233#
123#
123456789#
I want to cut off the last character.
${EXTEN:-1} gives me #, but that is the character I want to cut off.
Kind regards,
Jonas.
Here ya go:
112233# use ${EXTEN:0:6})
123# use ${EXTEN:0:3})
123456789# use ${EXTEN:0:9})
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.digium.com/pipermail/asterisk-users/attachments/20130820/e0f6831d/attachment.htm>