Function search

Source
pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str>
Expand description

Does a case sensitive search of the query you pass in the contents and returns matching lines

let query = "Guest";
let contents = "\
      This is a Guest line.
      Rust is safe, fast, productive.";

assert_eq!(vec!["This is a Guest line."], cli_program_doc::search(query, contents));