array
Source code
This file contains functions for manipulating arrays
Index
array::contains
Check if an array contains a value
Example
Arguments
- $1 (string): needle
- ... (array): elements to search
Exit codes
- 0: If the array contains the needle
- 1: If the array does not contain the needle
array::join
Join an array with a delimiter
Example
Arguments
- $1 (string): delimiter
- ... (array): elements to join
Output on stdout
- The joined array
array::nth
Get the nth element of an array
Example
Arguments
- $1 (string): new array name
- $2 (integer): nth element
- ... (array): elements to get nth element from
Was this section helpful?