---
schema_version: "1"
id: 76004314ee7ddef8dd532df30217f9404fc537ede38b7e78ac1b59cdca7097b8
title: substringAfter
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.9/dw-strings-functions-substringafter.md
canonical_url: https://docs.mulesoft.com/dataweave/2.9/dw-strings-functions-substringafter
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 45d162960da42b3d35c0fa97d8714a696fc5a5a2214d5f469f0e1f090e10a120
description: MuleSoft Documentation Site
release: "2.9"
latest: false
---
---
product: DataWeave
version: 2.9
---

# substringAfter

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

## substringAfter(text: String, separator: String): String

Gets the substring after the first occurrence of a separator. The separator is not returned.

_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><tr><td><p><code>separator</code></p></td><td><p>String to search for.</p></td></tr></tbody></table>

### Example

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

#### Source

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

#### Output

```JSON
{

  "a": null,
  "b": "",
  "c": "c",
  "d": "cba",
  "e": "",
  "f": "abc"
}
```

## substringAfter(text: Null, separator: String): Null

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

_Introduced in DataWeave version 2.2.0._
