Skip to content

Instantly share code, notes, and snippets.

View dandyvica's full-sized avatar
🎯

Alain Viguier dandyvica

🎯
View GitHub Profile
@EstebanBorai
EstebanBorai / split_string_slice_chunks.rs
Created October 17, 2020 05:14
Rust - Split string slice in chunks
use std::str;
fn main() {
let subs = "‌​‌​‌​​‌​‌".as_bytes()
.chunks(7)
.map(str::from_utf8)
.collect::<Result<Vec<&str>, _>>()
.unwrap();
println!("{:?}", subs);