---
schema_version: "1"
id: 73293b77d2257f4a1a40f88d23bad90ca253f9a34db78232ff2bae4ba918970c
title: Strings (dw::core::Strings)
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.3/dw-strings.md
canonical_url: https://docs.mulesoft.com/dataweave/2.3/dw-strings
source_site: docs.mulesoft.com
content_type: documentation
content_hash: dc87addae77b807187862fbb940a5a082763ff6de835ae3f9d8e00e958ca6f50
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
---
product: DataWeave
version: 2.3
---

# Strings (dw::core::Strings)

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

This module contains helper functions to work with Strings.

To use this module, you must import it to your DataWeave code, for example, by adding the line
`import * from dw::core::Strings` to the header of your DataWeave script.

## Functions

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-appendifmissing">appendIfMissing</a></p></td><td><p>Appends the <code>suffix</code> to the end of the <code>text</code> if the <code>text</code> does not already ends with the <code>suffix</code>.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-camelize">camelize</a></p></td><td><p>Returns a string in camel case based on underscores in the string.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-capitalize">capitalize</a></p></td><td><p>Capitalizes the first letter of each word in a string.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-charcode">charCode</a></p></td><td><p>Returns the Unicode for the first character in an input string.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-charcodeat">charCodeAt</a></p></td><td><p>Returns the Unicode for a character at the specified index.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-dasherize">dasherize</a></p></td><td><p>Replaces spaces, underscores, and camel-casing in a string with dashes (hyphens).</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-fromcharcode">fromCharCode</a></p></td><td><p>Returns a character that matches the specified Unicode.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-isalpha">isAlpha</a></p></td><td><p>Checks if the <code>text</code> contains only Unicode digits. A decimal point is not a Unicode digit and returns <code>false</code>.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-isalphanumeric">isAlphanumeric</a></p></td><td><p>Checks if the <code>text</code> contains only Unicode letters or digits.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-islowercase">isLowerCase</a></p></td><td><p>Checks if the <code>text</code> contains only lowercase characters.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-isnumeric">isNumeric</a></p></td><td><p>Checks if the <code>text</code> contains only Unicode digits.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-isuppercase">isUpperCase</a></p></td><td><p>Checks if the <code>text</code> contains only uppercase characters.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-iswhitespace">isWhitespace</a></p></td><td><p>Checks if the <code>text</code> contains only whitespace.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-leftpad">leftPad</a></p></td><td><p>The specified <code>text</code> is <em>left</em>-padded to the <code>size</code> using the <code>padText</code>. By default <code>padText</code> is <code>" "</code>.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-ordinalize">ordinalize</a></p></td><td><p>Returns a number as an ordinal, such as <code>1st</code> or <code>2nd</code>.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-pluralize">pluralize</a></p></td><td><p>Pluralizes a singular string.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-prependifmissing">prependIfMissing</a></p></td><td><p>Prepends the <code>prefix</code> to the beginning of the string if the <code>text</code> does not already start with that prefix.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-repeat">repeat</a></p></td><td><p>Repeats a <code>text</code> the number of specified <code>times</code>.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-rightpad">rightPad</a></p></td><td><p>The specified <code>text</code> is <em>right</em>-padded to the <code>size</code> using the <code>padText</code>. By default <code>padText</code> is <code>" "</code>.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-singularize">singularize</a></p></td><td><p>Converts a plural string to its singular form.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-substringafter">substringAfter</a></p></td><td><p>Gets the substring after the first occurrence of a separator. The separator is not returned.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-substringafterlast">substringAfterLast</a></p></td><td><p>Gets the substring after the last occurrence of a separator. The separator is not returned.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-substringbefore">substringBefore</a></p></td><td><p>Gets the substring before the first occurrence of a separator. The separator is not returned.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-substringbeforelast">substringBeforeLast</a></p></td><td><p>Gets the substring before the last occurrence of a separator. The separator is not returned.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-underscore">underscore</a></p></td><td><p>Replaces hyphens, spaces, and camel-casing in a string with underscores.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-unwrap">unwrap</a></p></td><td><p>Unwraps a given <code>text</code> from a <code>wrapper</code> text.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-withmaxsize">withMaxSize</a></p></td><td><p>Checks that the string length is no larger than the specified <code>maxLength</code>. If the string’s length is larger than the <code>maxLength</code>, the function cuts characters from left to right, until the string length meets the length limit.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-wrapifmissing">wrapIfMissing</a></p></td><td><p>Wraps <code>text</code> with <code>wrapper</code> if that <code>wrapper</code> is missing from the start or end of the given string.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-wrapwith">wrapWith</a></p></td><td><p>Wraps the specified <code>text</code> with the given <code>wrapper</code>.</p></td></tr></tbody></table>
