标签云

微信群

扫码加入我们

WeChat QR Code

This question already has an answer here:

How can I check if a string contains another string instead of using "==" to compare the whole string?

Regards


Here a benchmark for the most common ways to check if a string is in a string: jsben.ch/#/o6KmH

2018年09月24日43分38秒

didn't work when I use msgCache[id].headers.subject.indexOf("DELIVERY FAILURE:") > -1

2018年09月24日43分38秒

and the subject is: DELIVERY FAILURE: User fdfd.ablfdfitt (df.fdfdfdf.com) not listed in Domino Directory

2018年09月24日43分38秒

Well, what is msgCache[id].headers.subject?

2018年09月24日43分38秒

donald: Works for me: jsfiddle.net/bZUvp (and it also works with node.js, it's the same JavaScript)

2018年09月24日43分38秒

Actually, the message is inside an array [ 'DELIVERY FAILURE: User fdfd.ablfdfitt (df.fdfdfdf.com) not listed in Domino Directory' ] sorry for the mistake.

2018年09月25日43分38秒