diff options
| author | Tyge Løvset <[email protected]> | 2020-11-16 11:27:52 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-11-16 11:27:52 +0100 |
| commit | 56e3c5c17c55aab4f83e7f2d9f74288d5043bf6f (patch) | |
| tree | d1bdb465beb6b708450944f8b2091f2a8b29e6e3 /examples | |
| parent | 360c948953ee0b7313592371f537ec4bf1f1a127 (diff) | |
| download | STC-modified-56e3c5c17c55aab4f83e7f2d9f74288d5043bf6f.tar.gz STC-modified-56e3c5c17c55aab4f83e7f2d9f74288d5043bf6f.zip | |
Added cstr_contains(), cstr_begins_with(), cstr_ends_with(), and changed cstr_find*() to take a cstr_t value instead of pointer, because it returns an int position only, not iter reference.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/demos.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/demos.c b/examples/demos.c index 4c7e6a01..e6649af6 100644 --- a/examples/demos.c +++ b/examples/demos.c @@ -17,13 +17,13 @@ void stringdemo1() cstr_erase(&cs, 7, 5); // -nine
c_print(1, "{}.\n", cs.str);
- cstr_replace(&cs, cstr_find(&cs, "seven"), 5, "four");
+ cstr_replace(&cs, cstr_find(cs, "seven"), 5, "four");
c_print(1, "{}.\n", cs.str);
cstr_take(&cs, cstr_from_fmt("%s *** %s", cs.str, cs.str));
c_print(1, "{}.\n", cs.str);
- c_print(1, "find \"four\": {}\n", cs.str + cstr_find(&cs, "four"));
+ c_print(1, "find \"four\": {}\n", cs.str + cstr_find(cs, "four"));
// reassign:
cstr_assign(&cs, "one two three four five six seven");
|
