pub fn search_case_insensitive<'a>(
query: &str,
contents: &'a str,
) -> Vec<&'a str>
Expand description
Returns a vector of references to str
where each str
is a line that
matched case-insensitively a search for query
in contents
.
ยงExamples
fn main() {
let contents = "\
Rust:
safe, fast, productive.
Pick three.
Trust Me.";
let results = xer_minigrep::search_case_insensitive("rust", contents);
assert_eq!(vec!("Rust:", "Trust Me."), results);
}