2019-10-31 17:40:56 +00:00
|
|
|
# str
|
|
|
|
|
2020-05-26 22:19:18 +00:00
|
|
|
Applies the subcommand to a value or a table.
|
2019-10-31 17:40:56 +00:00
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
```shell
|
|
|
|
> shells
|
|
|
|
━━━┯━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
|
|
# │ │ name │ path
|
|
|
|
───┼───┼────────────┼────────────────────────────────
|
|
|
|
0 │ X │ filesystem │ /home/TUX/stuff/expr/stuff
|
|
|
|
1 │ │ filesystem │ /
|
|
|
|
━━━┷━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
2020-06-23 18:21:47 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```shell
|
2020-05-26 22:19:18 +00:00
|
|
|
> shells | str upcase path
|
2019-10-31 17:40:56 +00:00
|
|
|
━━━┯━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
|
|
# │ │ name │ path
|
|
|
|
───┼───┼────────────┼────────────────────────────────
|
|
|
|
0 │ X │ filesystem │ /HOME/TUX/STUFF/EXPR/STUFF
|
|
|
|
1 │ │ filesystem │ /
|
|
|
|
━━━┷━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
2020-06-23 18:21:47 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```shell
|
2020-05-26 22:19:18 +00:00
|
|
|
> shells | str downcase path
|
2019-10-31 17:40:56 +00:00
|
|
|
━━━┯━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
|
|
# │ │ name │ path
|
|
|
|
───┼───┼────────────┼────────────────────────────────
|
|
|
|
0 │ X │ filesystem │ /home/tux/stuff/expr/stuff
|
|
|
|
1 │ │ filesystem │ /
|
|
|
|
━━━┷━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
2020-06-23 18:21:47 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```shell
|
2020-05-26 22:19:18 +00:00
|
|
|
> shells | str substring "21, 99" path
|
2019-10-31 17:40:56 +00:00
|
|
|
━━━┯━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
|
|
# │ │ name │ path
|
|
|
|
───┼───┼────────────┼────────────────────────────────
|
|
|
|
0 │ X │ filesystem │ stuff
|
|
|
|
1 │ │ filesystem │
|
|
|
|
━━━┷━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
2020-06-23 18:21:47 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```shell
|
2020-05-26 22:19:18 +00:00
|
|
|
> shells | str substring "6," path
|
2019-10-31 17:40:56 +00:00
|
|
|
━━━┯━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
|
|
# │ │ name │ path
|
|
|
|
───┼───┼────────────┼────────────────────────────────
|
|
|
|
0 │ X │ filesystem │ TUX/stuff/expr/stuff
|
|
|
|
1 │ │ filesystem │
|
|
|
|
━━━┷━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
2020-06-23 18:21:47 +00:00
|
|
|
```
|
2019-11-01 22:25:08 +00:00
|
|
|
|
2020-06-23 18:21:47 +00:00
|
|
|
```shell
|
2020-07-13 19:07:34 +00:00
|
|
|
> echo "1, 2, 3" | split row "," | str to-int | math sum
|
2020-06-23 18:21:47 +00:00
|
|
|
6
|
|
|
|
```
|
2020-04-24 21:37:58 +00:00
|
|
|
|
2020-06-23 18:21:47 +00:00
|
|
|
```shell
|
2020-05-26 22:19:18 +00:00
|
|
|
> echo "nu" | str capitalize
|
2020-06-23 18:21:47 +00:00
|
|
|
Nu
|
|
|
|
```
|
2020-04-24 21:37:58 +00:00
|
|
|
|
2020-06-23 18:21:47 +00:00
|
|
|
```shell
|
2020-05-26 22:19:18 +00:00
|
|
|
> echo "Nu " | str trim
|
2020-06-23 18:21:47 +00:00
|
|
|
Nu
|
|
|
|
```
|
|
|
|
|
2020-07-14 20:47:04 +00:00
|
|
|
```shell
|
|
|
|
> echo "Nushell" | str reverse
|
|
|
|
llehsuN
|
|
|
|
```
|
|
|
|
|
2020-06-23 18:21:47 +00:00
|
|
|
```shell
|
2020-05-26 22:19:18 +00:00
|
|
|
> shells | str find-replace "TUX" "skipper" path
|
2020-04-25 06:07:38 +00:00
|
|
|
━━━┯━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
|
|
# │ │ name │ path
|
|
|
|
───┼───┼────────────┼────────────────────────────────
|
|
|
|
0 │ X │ filesystem │ /home/skipper/stuff/expr/stuff
|
|
|
|
1 │ │ filesystem │ /
|
|
|
|
━━━┷━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
|
|
```
|