diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-12-13 18:54:22 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-12-13 18:54:22 +0000 |
commit | 5063af682fde29b9d9a584d96bfb50222cb68b6b (patch) | |
tree | 91a26045041e1967f4ac923770013631bf73846e /doc | |
parent | 8b0389689d31a137314a4c0171b8aba73990c89d (diff) |
clarify substring documentation
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@7470 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'doc')
-rw-r--r-- | doc/README.variables | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/README.variables b/doc/README.variables index 933b3098e..e1ab04ffd 100644 --- a/doc/README.variables +++ b/doc/README.variables @@ -94,17 +94,17 @@ NoOp(${__FOO}) is identical to NoOp(${FOO}) -_______________________________ -REMOVING CHARACTERS FROM STRING -------------------------------- +___________________________________ +SELECTING CHARACTERS FROM VARIABLES +----------------------------------- -The format for removing characters from a variable can be expressed as: +The format for selecting 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 +If you want to select 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. +skip 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}) @@ -115,7 +115,7 @@ dial a number to access an outside line, but do not wish to pass the first digit. If you use a negative offset number, Asterisk starts counting from the end -of the string and then removes everything before the new position. The following +of the string and then selects everything after the new position. The following example will save the numbers 1234 to the 'number' variable, still assuming we've dialed 918005551234. |