string contains in Jquery

Like this:

if (str.indexOf("Yes") >= 0)
Note that this is case-sensitive. If you want a case-insensitive search, you can write

if (str.toLowerCase().indexOf("yes") >= 0)
Or,
if (/yes/i.test(str))

Comments

Popular posts from this blog

OCR text detection with google APIs C#

The specified version string contains wildcards, which are not compatible with determinism.

How to set dynamically height/width of an external image in rdlc report?