Skip to main content

exist_case_insensitive

Function exist_case_insensitive 

Source
pub fn exist_case_insensitive(s: &str) -> bool
Expand description

Checks if the given string is a valid Top-Level Domain (TLD), ignoring ASCII case.

This performs an O(1) lookup without allocating memory on the heap.

ยงExamples

assert!(tld::exist_case_insensitive("COM"));
assert!(tld::exist_case_insensitive("cOm"));
assert!(tld::exist_case_insensitive("io"));
assert!(!tld::exist_case_insensitive("nonexistent"));