[][src]Function nad2000_minigrep::search

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

Search a string in the text (case sensitive).

Example

let text = r#"I'm nobody! Who are you?
Are you nobody, too?
Then there's a pair of us - don't tell!
They'd banish us, you know.

How dreary to be somebody!
How public, like a frog
To tell your name the livelong day
To an admiring bog!
"#;

for line in search_case_insensitive("fro", text) {
    println!("{}", line);
}