如何检查一个字符串是否包含另一个字符串,而不是使用“ = =”来比较整个字符串?
问候
你可以使用 强 > .indexOf()强:
.indexOf()
if(str.indexOf(substr) > -1) { }