Hi,
If i have a string that looks like this abcd:ef how can extract to two variables in rust
example (not working)
let (a1, a2) = item.split(':').collect::<(&str, &str)>();
Hi,
If i have a string that looks like this abcd:ef how can extract to two variables in rust
example (not working)
let (a1, a2) = item.split(':').collect::<(&str, &str)>();
There's collect tuple in itertools: itertools::Itertools - Rust
In std, I think you'll have to call .next repeatedly.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.