---
title: "split"
manual: "TypoScript Explained"
version: "13.4"
permalink: "https://docs.typo3.org/permalink/t3tsref:split@13.4"
source: "Functions/Split.rst"
rendered: "2026-09-19T07:15:48+00:00"
---

# split {#split}

This object is used to split the input by a character and then parse
the result onto some functions.

For each iteration the split index starting with 0 (zero) is stored in
the register key `SPLIT_COUNT`.

-   [Properties](https://docs.typo3.org/permalink/t3tsref:properties@13.4)
-   [Example](https://docs.typo3.org/permalink/t3tsref:example@13.4)

## Properties {#split-properties}

### token {#split-token}

-   **token**

    -   *Type:* [string](https://docs.typo3.org/permalink/t3tsref:data-type-string@13.4) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    String or character (token) used to split the value.

### max {#split-max}

-   **max**

    -   *Type:* [integer](https://docs.typo3.org/permalink/t3tsref:data-type-integer@13.4) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    Maximum number of splits.

### min {#split-min}

-   **min**

    -   *Type:* [integer](https://docs.typo3.org/permalink/t3tsref:data-type-integer@13.4) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    Minimum number of splits.

### returnKey {#split-returnkey}

-   **returnKey**

    -   *Type:* [integer](https://docs.typo3.org/permalink/t3tsref:data-type-integer@13.4) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    Instead of parsing the split result, return the element of the
    index with this number immediately and stop processing of the split
    function.

### returnCount {#split-returncount}

-   **returnCount**

    -   *Type:* [boolean](https://docs.typo3.org/permalink/t3tsref:data-type-boolean@13.4) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    Counts all elements resulting from the split, returns their number
    and stops processing of the split function.

    **Example**

    **EXT:site_package/Configuration/TypoScript/setup.typoscript**

    ```typoscript
    # returns 9
    1 = TEXT
    1 {
      value = x,y,z,1,2,3,a,b,c
      split.token = ,
      split.returnCount = 1
    }

    ```

### cObjNum {#split-cobjnum}

-   **cObjNum**

    -   *Type:* *cObjNum* \+ [optionSplit](https://docs.typo3.org/permalink/t3tsref:optionsplit@13.4) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    This is a pointer the array of this object ("1,2,3,4"), that should
    treat the items, resulting from the split.

### 1,2,3,4 {#split-cobject}

-   **1,2,3,4,...**

    -   *Type:* [cObject](https://docs.typo3.org/permalink/t3tsref:data-type-cobject@13.4) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    The object that should treat the value.

    **Note:** The "current"-value is set to the value of current item,
    when the objects are called. See [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4) / current.

    **Example for stdWrap**

    **EXT:site_package/Configuration/TypoScript/setup.typoscript**

    ```typoscript
    1.current = 1
    1.wrap = <b> | </b>
    ```

    **Example for stdWrap**

    **EXT:site_package/Configuration/TypoScript/setup.typoscript**

    ```typoscript
    1 {
      10 = TEXT
      10.stdWrap.current = 1
      10.stdWrap.wrap = <b> | </b>
    }

    ```

### wrap {#split-wrap}

-   **wrap**

    -   *Type:* wrap + [optionSplit](https://docs.typo3.org/permalink/t3tsref:optionsplit@13.4) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    Defines a wrap for each item.

## Example {#split-examples}

This is an example of TypoScript code that imports the content of
field "bodytext" from the `$cObj->data-array` (ln 3). The content is
split by the line break character (ln 5). The items should all be
treated with a `stdWrap` (ln 6) which imports the value of the item (ln
7). This value is wrapped in a table row where the first column is a
bullet-gif (ln 8). Finally the whole thing is wrapped in the proper
table-tags (ln 10). :

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
20 = TEXT
20.stdWrap {
  field = bodytext
  split {
    token.char = 10
    cObjNum = 1
    1.current = 1
    1.wrap = <tr><td><img src="dot.gif"></td><td> | </td></tr>
  }
  stdWrap.wrap = <table style="width: 368px;"> | </table><br>
}

```
