nushell/docs/commands/str-rpad.md
Fernando Herrera dbcadbc12c moved folders
2022-02-07 19:23:12 +00:00

785 B

str rpad

pad a string with a character a certain length

Usage

> str rpad ...args {flags} 

Parameters

  • ...args: optionally check if string contains pattern by column paths

Flags

  • -h, --help: Display this help message
  • -l, --length (required parameter): length to pad to
  • -c, --character (required parameter): character to pad with

Examples

Right pad a string with a character a number of places

> echo 'nushell' | str rpad -l 10 -c '*'

Right pad a string with a character a number of places

> echo '123' | str rpad -l 10 -c '0'

Use rpad to truncate a string

> echo '123456789' | str rpad -l 3 -c '0'

Use rpad to pad Unicode

> echo '▉' | str rpad -l 10 -c '▉'