Skip to content

Commit

Permalink
docs: add last_part() function
Browse files Browse the repository at this point in the history
  • Loading branch information
linux-china committed Apr 19, 2024
1 parent dacf9ff commit 2ca7c90
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions info/stdlib.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ Like sub, but with all occurrences substituted, not just the first.
Splits the string s according to fs, placing the results in the array m. If fs is not specified then the FS variable is
used to split s.

### last_part(s [, sep])

Get last part with sep: `last_part("a/b/c", "/")` to `c`.

If sep is not provided, zawk will use `/` to search first, if not found, zawk will use `.` to search.

* `last_part("a/b/c")` to `c`
* `last_part("a.b.c")` to `c`

### sprintf(fmt, s, ...)

Returns a string formatted according to fmt and provided arguments. The goal is to provide the semantics of the libc
Expand Down

0 comments on commit 2ca7c90

Please sign in to comment.