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