---
title: split()
slug: split
docTags: 
createdAt: 2021-09-14T17:47:15.000Z
---

Divides a `String` into a list of Strings.

### Syntax

`split(string, delimiter)`

- `string` - the String value to be divided into an array of sub-Strings
- `delimiter` - the character or set of characters that indicate where to split the input String
- **Return type:** List

### Sample usage

`split("I am a string", ' ')` returns a list of component Strings consisting of `I`, `am`, `a`, and `string`

`split("This-is-text", '-')[2]` returns `text`

### Supported data types

| **Input type**                              | **Return type**                                          | **Logic**                                                                                                                                                           |
| ------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ****[String](docId\:Ujw2AQAktel5uukLuP73S)  | List, optionally [String](docId\:Ujw2AQAktel5uukLuP73S)  | If a String is passed, that String will be parsed into an array (list) of component Strings. Specifying the array index will return the String value of that index. |
| *Unsupported data types*                    | **[Null](docId\:N9trVqonnBknqL9DrNBP6)                   | Unsupported data types return `Null`.                                                                                                                               |

