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

前端 未结 8 2509
一个人的身影
一个人的身影 2020-12-08 00:57

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\",\"         


        
8条回答
  •  臣服心动
    2020-12-08 01:54

    try $.inArray http://api.jquery.com/jQuery.inArray/. I'm not sure if it will allow you to use a regular expression but its worth a try

提交回复
热议问题