[][src]Function envmnt::contains_ignore_case

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

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

extern crate envmnt;

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

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