# Intersection of Comma Separated Lists

> Compare two comma separated lists and find items exclusive to each list and items common to both.

- ID: `intersection_comma_separated_lists`
- Type: Block
- Category: [Strings](https://inventor.bot/docs/reference/blocks/strings.md)

**Inputs**

| Name | Required | Description | Value |
| --- | --- | --- | --- |
| `list_a` | yes | First comma separated list. | e.g. `"apple,banana,cherry"` |
| `list_b` | yes | Second comma separated list. | e.g. `"banana,cherry,date"` |

**Outputs**

| Name | Description | Value |
| --- | --- | --- |
| `exclusive_a` | Items only in List A. | e.g. `"apple"` |
| `exclusive_b` | Items only in List B. | e.g. `"date"` |
| `common` | Items present in both lists. | e.g. `"banana,cherry"` |

**Example**

```go
intersectionCommaSeparatedLists := intersection_comma_separated_lists(Args{list_a: "apple,banana,cherry", list_b: "banana,cherry,date"})
send_text_message(Args{
	channel_id:      trigger.channel_id,
	message_content: "Exclusive in A: " + intersectionCommaSeparatedLists.exclusive_a,
})
```