Hi people! I want to save the 1st letter from the ${EXTEN} variable. I don't want to trim it, I want to RESAVE it into a new variable. Let us assume the ${EXTEN} contains: 0698332977 then I'd love to get the 0 I would thank you for all advises. Tamer
Exten => x,n,Set($NEWVAR=${EXTEN,1:1}) -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Tamer Higazi Sent: Tuesday, February 24, 2009 2:52 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] receiving 1st digit from a variable Hi people! I want to save the 1st letter from the ${EXTEN} variable. I don't want to trim it, I want to RESAVE it into a new variable. Let us assume the ${EXTEN} contains: 0698332977 then I'd love to get the 0 I would thank you for all advises. Tamer _______________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Tamer Higazi wrote:> Hi people! > I want to save the 1st letter from the ${EXTEN} variable. I don't want > to trim it, I want to RESAVE it into a new variable. > > Let us assume the ${EXTEN} contains: 0698332977 then I'd love to get the 0Set(FIRSTDIGIT=${EXTEN:0:1}) substring options: first number: where to start (starts with zero) second number: how many characters regards klaus> I would thank you for all advises. > > > > Tamer > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users