[Asterisk-Users] Howto cut the first digit
Wolfgang Zweimueller
wzwei at kurtkrenn.com
Fri Mar 31 05:09:37 MST 2006
Christian Reelfs <chris at mynnga.de> writes:
> Hi, sorry for this noop question,
> but does anybody know how to cut the first digit of a variable?
>
> example:
> 044612345
> should be after cut operation:
> 44612345
Look at README.variables! It says:
,----
| The format for removing characters from a variable can be expressed as:
|
| ${variable_name[:offset[:length]]}
|
| If you want to remove the first N characters from the string assigned
| to a variable, simply append a colon and the number of characters to
| remove from the beginning of the string to the variable name.
|
| ;Remove the first character of extension, save in "number" variable
| exten => _9X.,1,Set(number=${EXTEN:1})
`----
cu,
Wolfgang
More information about the asterisk-users
mailing list