HP-UX AAA Server A.08.02 Administrator's Guide

Example 13 Examples Illustrating the Use of the offset Keyword
If Reply-Message = "a string of characters" , then:
Example 1
substr ( Reply-Message offset 0 length 8 )
returns the following string:
a string
Example 2
substr ( Reply-Message offset 16 length 82 )
returns the following string:
acters
Example 3
substr ( Reply-Message offset 12 )
returns the following string:
characters
Example 4
substr ( Reply-Message offset 32 )
returns an empty string.
NOTE: If <attr-spec> refers to an instance that is not present, then a no-such-instance run-time
error is generated.
The before Keyword
Syntax
substr (<attr-spec> before <before-string>)
substr (<attr-spec> before last <before-string>)
Parameters
Following are the parameters for the before keyword:
<attr-spec>: The <attr-spec> parameter is an attribute specification. For more
information on specifying attributes, see Attribute Specifications” (page 308).
<before-string>: Must be a quoted string constant.
Operation
Returns the requested substring with same type as the source.
If <before> is specified, the substring starts from the beginning of the string up to but not including
the first occurrence of <before-string>.
If <before-last> is specified, the substring starts from the beginning of the string up to but not
including the last occurrence of <before-string>.
NOTE: If <before> or <before-string> is not found, the entire string is returned.
Defining a Policy in a Decision File 313