Wednesday, 28 August 2013

How to search an array in Jquery like SQL LIKE value% statement

How to search an array in Jquery like SQL LIKE value% statement

I have an array with some values. How can I search that array using jQuery
for a value which is matched or close to it?
var a = ["foo","fool","cool","god","acl"];
If I want to search for c, then it should return cool but not acl.
How I can achieve that?

No comments:

Post a Comment