Skip to main content

has_keyword

Function has_keyword 

Source
pub fn has_keyword<'a>(
    target: impl MatchTarget<'a>,
    keyword: &str,
    ignore_case: bool,
) -> bool
Expand description

扫描输入文本是否包含指定的子串关键词。

匹配到的所有位置会被写入 target。

§参数

  • target: 匹配目标载体(&str 或 &mut State)。
  • keyword: 要查找的子串。
  • ignore_case: 是否忽略大小写(仅支持 ASCII 忽略大小写,以保证性能)。