Movatterモバイル変換


[0]ホーム

URL:


CFEngine documentation homepage

string_head

Suggest changes
Table of contents

Prototype:string_head(data, max)

Return type:string

Description: Returns the firstmax bytes ofdata.

Ifmax is negative, then everything but the lastmax bytes is returned.

Arguments:

  • data:string - Input string - in the range:.*
  • max:int - Maximum number of characters to return - in the range:-99999999999,99999999999

Example:

code
bodycommoncontrol{bundlesequence=>{"example"};}bundleagentexample{vars:"start"string=>string_head("abc","1");# will contain "a"reports:"start of abc =$(start)";}

Output:

code
R: start of abc = a

History: Introduced in CFEngine 3.6

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

Still need help?

Chat Ask a question on Github Mailing list
Version 
master3.24 (LTS)3.21 (LTS)view all versions

[8]ページ先頭

©2009-2025 Movatter.jp