diff options
| author | Tyge Lovset <[email protected]> | 2022-09-06 19:30:51 +0200 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2022-09-06 19:30:51 +0200 |
| commit | a65d94a54ba98ca1fa743d6c70a9b243afad47da (patch) | |
| tree | 16839d8497eaf9f3cab4e5eb7c0efd3db507d35a /docs/csview_api.md | |
| parent | 90311ff7eb34e5fc4fc1c2c38b8d0433642e9659 (diff) | |
| download | STC-modified-a65d94a54ba98ca1fa743d6c70a9b243afad47da.tar.gz STC-modified-a65d94a54ba98ca1fa743d6c70a9b243afad47da.zip | |
Updated docs for cregex and csview.
Diffstat (limited to 'docs/csview_api.md')
| -rw-r--r-- | docs/csview_api.md | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/csview_api.md b/docs/csview_api.md index 65e9a066..9da64cb2 100644 --- a/docs/csview_api.md +++ b/docs/csview_api.md @@ -79,6 +79,13 @@ csview cstr_u8_substr(const cstr* self, size_t bytepos, size_t u8len); csview cstr_slice(const cstr* self, size_t p1, size_t p2); csview cstr_slice_ex(const cstr* s, intptr_t p, intptr_t q); // negative p or q count from end ``` +### Iterate tokens: c_foreach_token, c_foreach_token_sv + +To iterate tokens in an input string separated by a string: +```c +c_foreach_token (i, "hello, one, two, three", ", ") + printf("token: %.*s\n", c_ARGsv(i.token)); +``` #### Helper methods ```c |
