string_reverse

Table of Contents

Prototype: string_reverse(data)

Return type: string

Description: Returns data reversed.

Arguments:

  • data: string, in the range: .*

Example:

body common control
{
      bundlesequence => { "example" };
}

bundle agent example
{
  vars:
      "reversed"
      string =>  string_reverse("abc"); # will contain "cba"
  reports:
      "reversed abs = $(reversed)";
}

Output:

R: reversed abs = cba

History: Introduced in CFEngine 3.6

See also: string_head(), string_tail(), string_length().