Function yarns::substr [] [src]

pub fn substr(word: &String, start: usize, length: usize) -> String

Returns a new string starting at the index provided in the second argument, going the length provided as the third argument.

let hello = String::from("Hello");
let sub= yarns::substr(&hello, 1, 3);
//sub = (String) "ell"