判断 字符串中 有无某段字符

// Use `.includes()`, rather than `.indexOf()`, when checking for existence.
str.includes(searchString[, position]) // 方法用于判断一个字符串是否包含在另一个字符串中,根据情况返回 true 或 false。

// position 可选从当前字符串的哪个索引位置开始搜寻子字符串,默认值为 0

// 如果当前字符串包含被搜寻的字符串,就返回 true;否则返回 false。 (区分大小写)

 

  

 

 ummmmm

 

posted @ 2021-11-02 17:11  Naijiaz  阅读(192)  评论(0)    收藏  举报