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

# String Matchers Reference

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

## 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/2.3/munit-matchers)

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

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

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