какие возможны манипуляции с текстовыми переменными???
знаю к примеру ${EXTEN:1} - пропустить первый символ....
где еще можно посмотреть возможности, поиском не получилось найти!
Интересны все манипуляции, а в данный момент особенно как убрать последний, символ, например:
было 1234
${EXTEN:1} - даст 234
а как получить 123 ????
манипуляции с текстовыми переменными
Модераторы: Admins, Модераторы
Код: Выделить всё
Substrings
${foo:offset:length}
returns a substring of the string foo, beginning at offset offset and returning the next length characters. The first character is at offset 0.
* If offset is negative, it is taken leftwards from the right hand end of the string.
* If length is omitted or is negative, then all the rest of the string beginning at offset is returned.
Examples:
${123456789:1} - returns the string 23456789
${123456789:-4} - returns the string 6789
${123456789:0:3} - returns the string 123
${123456789:2:3} - returns the string 345
${123456789:-4:3} - returns the string 678
Examples of use:
exten => _NXX.,1,SetVar(areacode=${EXTEN:0:3}) - get the first 3 digits of ${EXTEN}
exten => _516XXXXXXX,1,Dial(${EXTEN:3}) - get all but the first 3 digits of ${EXTEN}
exten => 100,1,SetVar(whichVowel=4)
exten => 100,2,SetVar(foo=AEIOU:${whichVowel}:1) - sets ${foo} to the single letter 'U'
Re: манипуляции с текстовыми переменными
А проверку по поводу нахождения подстроки в строке кто нибудь делал?)
ExecIf($[ ${VARIABLE} содержит "ТЕКСТ" ]?..)
ExecIf($[ ${VARIABLE} содержит "ТЕКСТ" ]?..)
облачные сервера asterisk/freepbx/a2billing/espocrm с полной техподдержкой, от 1490-мес. skype: whoim2, whoim@asterisk.ru