Function obfstr::position[][src]

pub const fn position(haystack: &str, needle: &str) -> Range<usize>

Finds the position of the needle in the haystack at compiletime.

Produces a const-eval error if the needle is not a substring of the haystack.

const POSITION: std::ops::Range<usize> = obfstr::position("haystack", "st");
assert_eq!(POSITION, 3..5);