Copy as Markdown View as Markdown (opens in new tab) View on GitHub (opens in new tab) Open in... ChatGPT (opens in new tab) Claude (opens in new tab) Perplexity (opens in new tab) lines lines(text: String): Array<String> Returns an array of lines from a string. Introduced in DataWeave version 2.4.0. Parameters Name Description text The string to split into lines. Example This example divides a string into lines. An \n represents a line break. Source %dw 2.0 import lines from dw::core::Strings output application/json --- lines("hello world\n\nhere data-weave") Output ["hello world", "", "here data-weave"] lines(text: Null): Null Helper function that enables lines to work with a null value. Introduced in DataWeave version 2.4.0.