[][src]Function string_tools::get_all_before_strict

pub fn get_all_before_strict<'a>(text: &'a str, begin: &str) -> Option<&'a str>

Return the part of a str which is before an occurence or return None if there is no occurence.

use string_tools::get_all_before_strict;
 
assert_eq!(get_all_before_strict("azertyuiopqsdfghjklmwxcvbn", "sdf"), Some("azertyuiopq"));
assert_eq!(get_all_before_strict("azertyuiopqsdfghjklmwxcvbn", "123"), None);