pub fn contains_ignore_case<K: AsRef<OsStr>>(key: K, value: &str) -> bool
Expand description

Returns true if the provided environment variable is defined and contains the provided value regardless of the case.

Arguments

  • key - The environment variable name
  • value - The value to check

Example

fn main() {
    envmnt::set("MY_ENV_VAR", "SOME TEST VALUE");

    let contains = envmnt::contains_ignore_case("MY_ENV_VAR", "test");
    assert!(contains);
}