str reverse

For strings.

Reverse every string in the pipeline.

Command Type

built-in

Signature

> str reverse {flags} ...rest

Parameters

  • ...rest: For a data structure input, reverse strings at the given cell paths.

Input/output types:

input output
string string
list<string> list<string>
table table
record record

Examples

Reverse a single string.

> 'Nushell' | str reverse
llehsuN

Reverse multiple strings in a list.

> ['Nushell' 'is' 'cool'] | str reverse
╭───┬─────────╮
│ 0 │ llehsuN │
│ 1 │ si      │
│ 2 │ looc    │
╰───┴─────────╯

Ported from nushell/nushell.github.io. Copyright (c) 2021 Nushell Project. MIT License.