summaryrefslogtreecommitdiffhomepage
path: root/docs/csview_api.md
diff options
context:
space:
mode:
authorTyge Lovset <[email protected]>2022-09-06 19:30:51 +0200
committerTyge Lovset <[email protected]>2022-09-06 19:30:51 +0200
commita65d94a54ba98ca1fa743d6c70a9b243afad47da (patch)
tree16839d8497eaf9f3cab4e5eb7c0efd3db507d35a /docs/csview_api.md
parent90311ff7eb34e5fc4fc1c2c38b8d0433642e9659 (diff)
downloadSTC-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.md7
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