mirror of
https://codeberg.org/andyscott/ziglings.git
synced 2024-11-08 19:20:47 -05:00
Merge pull request 'fix(103_tokenization): ✏️ Migrated to tokenizeAny' (#5) from rond/exercises:main into main
Reviewed-on: https://codeberg.org/ziglings/exercises/pulls/5
This commit is contained in:
commit
a286403250
2 changed files with 4 additions and 4 deletions
|
@ -62,7 +62,7 @@
|
|||
// // A standard tokenizer is called (Zig has several) and
|
||||
// // used to locate the positions of the respective separators
|
||||
// // (we remember, space and comma) and pass them to an iterator.
|
||||
// var it = std.mem.tokenize(u8, input, " ,");
|
||||
// var it = std.mem.tokenizeAny(u8, input, " ,");
|
||||
//
|
||||
// // The iterator can now be processed in a loop and the
|
||||
// // individual numbers can be transferred.
|
||||
|
@ -136,7 +136,7 @@ pub fn main() !void {
|
|||
;
|
||||
|
||||
// now the tokenizer, but what do we need here?
|
||||
var it = std.mem.tokenize(u8, poem, ???);
|
||||
var it = std.mem.tokenizeAny(u8, poem, ???);
|
||||
|
||||
// print all words and count them
|
||||
var cnt: usize = 0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
139c139
|
||||
< var it = std.mem.tokenize(u8, poem, ???);
|
||||
< var it = std.mem.tokenizeAny(u8, poem, ???);
|
||||
---
|
||||
> var it = std.mem.tokenize(u8, poem, " ,;!\n");
|
||||
> var it = std.mem.tokenizeAny(u8, poem, " ,;!\n");
|
||||
|
|
Loading…
Reference in a new issue