Free MuleSoft CONNECT Keynote & Expo Pass Available!

Register now+
Nav

capitalize

capitalize(String): String

Returns the provided string with every word starting with a capital letter and no underscores. It also replaces underscores with spaces and puts a space before each capitalized word.

Transform

        
     
1
2
3
4
5
6
7
8
9
10
%dw 2.0
import * from dw::core::Strings
output application/json
---
{
  a: capitalize("customer"),
  b: capitalize("customer_first_name"),
  c: capitalize("customer NAME"),
  d: capitalize("customerName")
}
Output

        
     
1
2
3
4
5
6
{
  "a": "Customer",
  "b": "Customer First Name",
  "c": "Customer Name",
  "d": "Customer Name"
}