Report templatesFunctions

joinWith

Join array elements into a string with a specified separator

Usage

The joinWith function concatenates array elements into a single string using the specified separator.

Syntax

{array | joinWith:glue}

Parameters

  • input (array): Array of elements to join
  • glue (string): Separator to place between elements

Returns

A string with all array elements joined by the specified separator

Examples

Basic joining

{["apple", "banana", "orange"] | joinWith:", "}
// Returns: "apple, banana, orange"

Line breaks

{["Line 1", "Line 2", "Line 3"] | joinWith:"\n"}
// Returns: "Line 1\nLine 2\nLine 3"

No separator

{["A", "B", "C"] | joinWith:""}
// Returns: "ABC"

With pipes

{["option1", "option2", "option3"] | joinWith:" | "}
// Returns: "option1 | option2 | option3"

Joining IPs

{project.scope | filterIpsFromScope | joinWith:", "}
// Returns: "192.168.1.1, 10.0.0.1, 172.16.0.1"

Building lists

{vulnerabilities.names | joinWith:" • "}
// Returns: "SQL Injection • XSS • CSRF"

Use Cases

  • Creating comma-separated lists
  • Building formatted output from arrays
  • Generating readable scope lists
  • Creating bullet-point lists in reports
  • Combining multiple values for display