---
schema_version: "1"
id: d66d91d3ecbf876c5be1e2726c28fffe2e62932136af95f89896c94e602b21ef
title: String Matchers Reference
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/munit/3.6/string-matchers-reference.md
canonical_url: https://docs.mulesoft.com/munit/3.6/string-matchers-reference
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 45ae1a18031e9510f1e0b601e46803deea2b2b65d243d60f9fbed2578de6fc1d
description: MuleSoft Documentation Site
release: "3.6"
latest: false
---
---
product: MUnit
version: 3.6
---

# String Matchers Reference

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

![logo acb active](/mulesoft/current/en-us/_/img/icons/anypoint-code-builder.svg "Anypoint Code Builder")Anypoint Code
Builder

![logo studio active](/mulesoft/current/en-us/_/img/icons/studio.svg "Anypoint Studio")Anypoint Studio

## containsString(String)

Checks that the expression contains the specified String.

Example

```xml
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::containsString('example')]"/>
```

## startsWith(String)

Checks that the expression starts with the specified String.

Example

```xml
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::startsWith('exam')]"/>
```

## endsWith(String)

Checks that the expression ends with the specified String.

Example

```xml
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::endsWith('ple')]"/>
```

## isEmptyString()

Checks that the expression has zero length.

Example

```xml
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::isEmptyString()]"/>
```

## isEmptyOrNullString()

Checks that the expression is null, or has zero length.

Example

```xml
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::isEmptyOrNullString()]"/>
```

## equalToIgnoringCase(String)

Checks that the expression is equal to the specified String, ignoring case.

Example

```xml
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::equalToIgnoringCase('example')]"/>
```

## equalToIgnoringWhiteSpace(String)

Checks that the expression is equal to the string disregarding leading and trailing white spaces,
and compression all inner white spaces to a single space.

Example

```xml
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::equalToIgnoringWhiteSpace('An Example')]"/>
```

## stringContainsInOrder(Array<String>)

Checks that the expression contains all of the specified substrings, regardless of the order of
their appearance.

Example

```xml
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::stringContainsInOrder(['an', 'example'])]"/>
```

## See Also

- [MUnit Matchers](https://docs.mulesoft.com/munit/3.6/munit-matchers)

- [Core Matchers Reference](https://docs.mulesoft.com/munit/3.6/core-matchers-reference)

- [Comparable Matchers Reference](https://docs.mulesoft.com/munit/3.6/comparable-matchers-reference)

- [Iterable and Map Matchers Reference](https://docs.mulesoft.com/munit/3.6/iterable-map-matchers-reference)
