[asterisk-users] receiving 1st digit from a variable

Klaus Darilion klaus.mailinglists at pernau.at
Tue Feb 24 16:03:13 CST 2009


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 0

Set(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




More information about the asterisk-users mailing list