---
schema_version: "1"
id: 3dd064534ed9973b76e6f0388a9d3ed97314278c2984e57939c14530362343a6
title: words
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.9/dw-strings-functions-words.md
canonical_url: https://docs.mulesoft.com/dataweave/2.9/dw-strings-functions-words
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 9dc867c9baa09bc10800c085afa44dcb3c738196e7eb80173c44ab7c0c178218
description: MuleSoft Documentation Site
release: "2.9"
latest: false
---
---
product: DataWeave
version: 2.9
---

# words

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## words(text: String): Array<String>

Returns an array of words from a string.

Separators between words include blank spaces, new lines, and tabs.

_Introduced in DataWeave version 2.4.0._

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>text</code></p></td><td><p>The string to split into words.</p></td></tr></tbody></table>

### Example

This example divides a string by the `words` it contains. An `\n` represents a line break, and `\t`
represents a tab.

#### Source

```DataWeave
%dw 2.0
import words from dw::core::Strings
output application/json
---
words("hello world\nhere\t\t\tdata-weave")
```

#### Output

```Json
["hello", "world", "here", "data-weave"]
```

## words(text: Null): Null

Helper function that enables `words` to work with a `null` value.

_Introduced in DataWeave version 2.4.0._
