# split-list

## Description

<mark style="color:purple;">`split-list`</mark> *adaptor splits a list into two lists at the first instance of a specified separator value.*

## Inputs

**`list`**\
Type: `list`\
Required: Yes\
The list to be split.

**`separator`**\
Type: `text`\
Required: Yes\
The value at which the list is split.

**`append`**\
Type: `boolean`\
Required: No\
Whether to append the separator value to the first list. If unspecified, defaults to `False`.

**`prepend`**\
Type: `boolean`\
Required: No\
Whether to prepend the separator value to the second list. If unspecified, defaults to `False`.

## Outputs

**`first`**\
Type: `list`\
A list containing the values before the separator value.

**`second`**\
Type: `list`\
A list containing the values after the separator value.

## Examples

### Example 1: Default behaviour.

#### Inputs:

`list`:

1. 100
2. 2
3. 1
4. 10
5. 200

`separator`: 1

`append`: *null(empty)*

`prepend`: *null(empty)*

#### Outputs:

`first`:

1. 100
2. 2

`second`:

1. 10
2. 200

-> Split a list into two based on the separator `1`.

### Example 2: Append separator value to the list.

#### Inputs:

`list`:

1. 100
2. 2
3. 1
4. 10
5. 200

`separator`: 1

`append`: *null(empty)*

`prepend`: True

#### Outputs:

`first`:

1. 100
2. 2
3. 1

`second`:

1. 10
2. 200

-> Split a list into two based on the separator `1` and appended the value.

### Example 3: Prepend separator value to the list.

#### Inputs:

`list`:

1. 100
2. 2
3. 1
4. 10
5. 200

`separator`: 1

`append`: *null(empty)*

`prepend`: True

#### Outputs:

`first`:

1. 100
2. 2

`second`:

1. 1
2. 10
3. 200

-> Split a list into two based on the separator `1` and prepended the value.
