2022-02-14 02:22:51 +00:00
|
|
|
---
|
|
|
|
title: empty?
|
|
|
|
layout: command
|
|
|
|
version: 0.59.0
|
|
|
|
---
|
2020-10-06 10:21:20 +00:00
|
|
|
|
2022-02-14 02:22:51 +00:00
|
|
|
Check for empty values.
|
2020-10-06 10:21:20 +00:00
|
|
|
|
2022-02-14 02:22:51 +00:00
|
|
|
## Signature
|
2020-10-06 10:21:20 +00:00
|
|
|
|
2022-02-14 02:22:51 +00:00
|
|
|
```> empty? ...rest --block```
|
2020-10-06 10:21:20 +00:00
|
|
|
|
2022-02-14 02:22:51 +00:00
|
|
|
## Parameters
|
2020-10-06 10:21:20 +00:00
|
|
|
|
2022-02-14 02:22:51 +00:00
|
|
|
- `...rest`: the names of the columns to check emptiness
|
|
|
|
- `--block {block}`: an optional block to replace if empty
|
|
|
|
|
|
|
|
## Examples
|
2020-10-06 10:21:20 +00:00
|
|
|
|
2022-02-14 02:22:51 +00:00
|
|
|
Check if a value is empty
|
2020-10-06 10:21:20 +00:00
|
|
|
```shell
|
2022-02-14 02:22:51 +00:00
|
|
|
> '' | empty?
|
2020-10-06 10:21:20 +00:00
|
|
|
```
|
|
|
|
|
2022-02-14 02:22:51 +00:00
|
|
|
more than one column
|
2020-10-06 10:21:20 +00:00
|
|
|
```shell
|
2022-02-14 02:22:51 +00:00
|
|
|
> [[meal size]; [arepa small] [taco '']] | empty? meal size
|
2020-10-06 10:21:20 +00:00
|
|
|
```
|
|
|
|
|
2022-02-14 02:22:51 +00:00
|
|
|
use a block if setting the empty cell contents is wanted
|
2020-10-06 10:21:20 +00:00
|
|
|
```shell
|
2022-02-20 01:13:33 +00:00
|
|
|
> [[2020/04/16 2020/07/10 2020/11/16]; ['' [27] [37]]] | empty? 2020/04/16 -b { |_| [33 37] }
|
2020-10-06 10:21:20 +00:00
|
|
|
```
|