是否有任何方法像javascript中的c#.net的string.contains [英] Is there any method like string.contains of c#.net in javascript

查看:96
本文介绍了是否有任何方法像javascript中的c#.net的string.contains的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从数组中删除元素(如果它包含小的匹配字符串),如下所示,

i want to delete the element from the array if it contains small matching string also like below,

array=["india 1","india 2", "Australia"];


从这个数组中,我想删除包含印度"的元素

提前thx


from this array i want to delete the element which contains "india"

thx in advance

推荐答案

是- indexof [ ^ ]如果搜索字符串不在目标字符串.
Yes - indexof[^] it returns -1 if the search string is not in the target string.


这篇关于是否有任何方法像javascript中的c#.net的string.contains的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆