[−][src]Function string_tools::get_idx_before
pub fn get_idx_before(text: &str, begin: &str) -> usize
Return the index of an occurence. If there is no occurence, the index is the len of the text.
use string_tools::get_idx_before; assert_eq!(get_idx_before("azertyuiopqsdfghjklmwxcvbn", "sdf"), 11); assert_eq!(get_idx_before("azertyuiopqsdfghjklmwxcvbn", "123"), 26);