Table of Contents
string_tail
Table of Contents
Prototype: string_tail(data, max)
Return type: string
Description: Returns the last max
bytes of data
.
If max
is negative, then everything but the first max
bytes is returned.
Arguments:
Example:
body common control
{
bundlesequence => { "example" };
}
bundle agent example
{
vars:
"end" string => string_tail("abc", "1"); # will contain "c"
reports:
"end of abc = $(end)";
}
Output:
R: end of abc = c
History: Introduced in CFEngine 3.6
See also: string_head()
, string_length()
, string_reverse()
.