Function split

Source
pub fn split(text: String, delimiter: Option<&str>) -> Vec<String>
Expand description

Split a string into a vector of strings

ยงExample

use pythonic_helper::strings::split;
 
let text = String::from("Hello World");
let delimiter = " ";
let words = split(text, Some(delimiter));
 
let expected = vec![String::from("Hello"), String::from("World")];
assert_eq!(words, expected);
assert_eq!(words.len(), 2);