var a='http://localhost:8088/CustomForm/CustomForm/TableMobelRfForm/Index?_FormId=102417&SN=75648_16' js 怎么判断a里面是否包含/CustomForm/CustomForm/
时间: 2023-10-07 18:08:44 浏览: 57
可以使用JavaScript中的`includes()`方法来判断字符串中是否包含某个子字符串。使用方法如下:
```javascript
var a = 'http://localhost:8088/CustomForm/CustomForm/TableMobelRfForm/Index?_FormId=102417&SN=75648_16';
if (a.includes('/CustomForm/CustomForm/')) {
console.log('字符串a中包含/CustomForm/CustomForm/');
} else {
console.log('字符串a中不包含/CustomForm/CustomForm/');
}
```
输出结果为:
```
字符串a中包含/CustomForm/CustomForm/
```
阅读全文