Implement take command and comments (--) + misc cleanup
This commit is contained in:
18
HELP.md
18
HELP.md
@@ -62,6 +62,18 @@ str %> replace oo OO; replace ba BA
|
||||
str %>
|
||||
```
|
||||
|
||||
Comments start with `--` and run through the end of the line. Example:
|
||||
|
||||
```text
|
||||
str %> = abc -- my comment
|
||||
┌───────────────
|
||||
│ 0 │abc
|
||||
├───────────────
|
||||
│ :: string
|
||||
└───────────────
|
||||
str %>
|
||||
```
|
||||
|
||||
|
||||
## Data Types
|
||||
|
||||
@@ -231,6 +243,12 @@ Delete the specified word/line/index from the current subject.
|
||||
`index` is applied for destructured subjects. For destructured subjects you may omit the type (e.g. `drop 4`).
|
||||
Example: `foo bar baz` -> `drop word 1` -> `foo baz`
|
||||
|
||||
#### `take <word|line|index> <index>`
|
||||
Keep only the specified word/line/index from the current subject.
|
||||
`word` and `line` apply to strings that have not been destructured.
|
||||
`index` is applied for destructured subjects. For destructured subjects you may omit the type (e.g. `take 4`).
|
||||
Example: `foo bar baz` -> `take word 1` -> `bar`
|
||||
|
||||
#### `contains <find>`
|
||||
If the subject contains the given substring, keep it. Otherwise, replace it with an empty string.
|
||||
Most often used in conjunction with `line`, `word`, or `each` for filtering.
|
||||
|
||||
Reference in New Issue
Block a user