Problem in indexOf in javascript
<p>I want to find out if a variable value contains in second string. My code is</p>

<pre><code>if (ext.indexOf(FileUploadval.substring(FileUploadval.lastIndexOf('.') + 1)) == -1) {
}
</code></pre>

<p>where ext have value pdf,doc,dox,xls,xlsx,ppt,pptx and when i try xls or xlsx file it goes in if condition but when i try doc or pdf it doesnot go in if condition. what can be the problem?</p>
