Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

compare string camelcase and lowercase javascript

var haystack = "A. BAIL. Of. Hay.";
var needle = "bail.";
var needleRegExp = new RegExp(needle.replace(/[-[]{}()*+?.,^$|#s]/g, "$&"), "i");
var result = needleRegExp.test(haystack);
if (result) {
    // Your code here
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #compare #string #camelcase #lowercase #javascript
ADD COMMENT
Topic
Name
8+8 =