%dw 2.0 import collapse from dw::core::Strings output application/json --- collapse("a b babb a")
Collapses the string into substrings of equal characters.
Each substring contains a single character or identical characters that are adjacent to one another in the input string. Empty spaces are treated as characters.
Introduced in DataWeave version 2.4.0.