Nav

isBlank

isBlank(String): Boolean

Returns true if it receives a string composed of only whitespace characters.

Transform

        
     
1
2
3
4
5
6
7
8
%dw 2.0
output  application/json
---
{
  empty: isBlank(""),
  withSpaces: isBlank("      "),
  withText: isBlank(" 1223")
}
Output

        
     
1
2
3
4
5
  {
    "empty": true,
    "withSpaces": true,
    "withText": false
  }