joinWith
The joinWith function concatenates array elements into a single string using the specified separator.
Syntax
Section titled “Syntax”{array | joinWith:glue}Parameters
Section titled “Parameters”input(array): Array of elements to joinglue(string): Separator to place between elements
Returns
Section titled “Returns”A string with all array elements joined by the specified separator
Examples
Section titled “Examples”Basic joining
Section titled “Basic joining”{["apple", "banana", "orange"] | joinWith:", "}// Returns: "apple, banana, orange"Line breaks
Section titled “Line breaks”{["Line 1", "Line 2", "Line 3"] | joinWith:"\n"}// Returns: "Line 1\nLine 2\nLine 3"No separator
Section titled “No separator”{["A", "B", "C"] | joinWith:""}// Returns: "ABC"With pipes
Section titled “With pipes”{["option1", "option2", "option3"] | joinWith:" | "}// Returns: "option1 | option2 | option3"Joining IPs
Section titled “Joining IPs”{project.scope | filterIpsFromScope | joinWith:", "}// Returns: "192.168.1.1, 10.0.0.1, 172.16.0.1"Building lists
Section titled “Building lists”{vulnerabilities.names | joinWith:" • "}// Returns: "SQL Injection • XSS • CSRF"Use Cases
Section titled “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