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