---
schema_version: "1"
id: c468e09ae78f7c1b7b4dbcb46f008b8e56331ea7d65de3312ad900d3e6ccbcb5
title: isWhitespace
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/latest/dw-strings-functions-iswhitespace.md
canonical_url: https://docs.mulesoft.com/dataweave/latest/dw-strings-functions-iswhitespace
source_site: docs.mulesoft.com
content_type: documentation
content_hash: e68b4eb1155187b885605a0b4172253af3d5b92609cbbd98ae788fc305702d36
description: MuleSoft Documentation Site
release: "2.13"
latest: true
---
---
product: DataWeave
version: 2.13
is-latest-version: true
---

# isWhitespace

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

## isWhitespace(text: String): Boolean

Checks if the `text` contains only whitespace.

_Introduced in DataWeave version 2.2.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 input string.</p></td></tr></tbody></table>

### Example

This example shows how `isWhitespace` behaves with different inputs and sizes.

#### Source

```DataWeave
%dw 2.0
import isWhitespace from dw::core::Strings
output application/json
---
{
  "a": isWhitespace(null),
  "b": isWhitespace(""),
  "c": isWhitespace("  "),
  "d": isWhitespace("abc"),
  "e": isWhitespace("ab2c"),
  "f": isWhitespace("ab-c")
}
```

#### Output

```JSON
{
  "a": false,
  "b": true,
  "c": true,
  "d": false,
  "e": false,
  "f": false
}
```

## isWhitespace(text: Null): Boolean

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

_Introduced in DataWeave version 2.2.0._
