<div class="meta" robots="noindex">

</div>

Method

# Split

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `String.Split<string.split>` as a replacement.

</div>

## Description

Creates a one-dimensional array from the `String</api/data_types/string>`.

## Usage

**result** = *source*.**Split**(\[*delimiter*\])

| Part        | Type                                   | Description                                                                                                                            |
|-------------|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|
| *result*    | `String</api/data_types/string>` array | Array resulting from breaking *source* into elements using *delimiter* as the field delimiter.                                         |
| *source*    | `String</api/data_types/string>`       | Source string to be parsed into an array.                                                                                              |
| *delimiter* | `String</api/data_types/string>`       | Optional field delimiter used to parse *Source* into array elements. If *delimiter* is omitted, then a space is used as the delimiter. |

## Notes

Use the <span class="title-ref">Split</span> function to create a new `String</api/data_types/string>` array from a list of elements (or fields) that are separated by a delimiter. If the optional parameter, delimiter, is not passed, a single space is assumed as the delimiter. If the delimiter is an empty string, the source string is <span class="title-ref">Split</span> into characters.

## Sample code

The section of code specifies the comma delimiter and the second uses the default delimiter. They place each field into an array element, producing a three-element array. The last code section parses the string into individual characters.

``` xojo
Var anArray() As String
Var s As String
s = "Adam,Aardvark,Accountant"
anArray = s.Split(",") ' produces 3-element array
anArray = s.Split("") ' produces array of individual characters
```

## Compatibility

All project types on all supported operating systems.

## See also

`String</api/data_types/string>` parent class; `String</api/data_types/string>` data type; `Var</api/language/var>` statement; `Array</api/language/array>`, `String.FromArray<string.fromarray>`, `Arrays</api/language/arrays>` concept
