is_within

Function is_within 

Source
pub fn is_within<T>(content: &str, range: &Range<T>) -> bool
where T: PrimInt,
Expand description

Checks if a closed range exists in given string content.

ยงExample:

use query_range::is_within;

let test_str = "this is a test";

let range = 0..2;
assert_eq!(is_within(test_str, &range), true);

let range02 = 20..25;
assert_eq!(is_within(test_str, &range02), false);