函数原型
func (s1 string) icontains(s2 string) bool
参数介绍
举例
-
Response
-
匹配语句:
response.body_string.icontains("abc123") -
输出结果:
true -
匹配语句:
response.body_string.icontains("abc124") -
输出结果:
true -
匹配语句:
response.body_string.icontains("ASD123") -
输出结果:
true
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
icontains函数主要是用来对字符串中的数据进行匹配,并通过返回一个bool的结果来判断是否匹配成功,与contains不同的是,icontains 忽略大小写
func (s1 string) icontains(s2 string) bool
| 参数名称 | 参数介绍 |
|---|---|
| s1 | 被匹配的数据 |
| s2 | 要匹配的数据 |
HTTP/1.1 200 OK
Server: nginx
Date: Sat, 07 Jan 2023 10:41:06 GMT
Content-Type: text/html; charset=utf-8
Connection: close
Vary: Accept-Encoding
Cache-Control: no-cache
Content-Length: 2180
<!DOCTYPE html>
<html>
<head>
<title>abc123</title>
</head>
<body>
asd123
ABC124
</body>
</html>
response.body_string.icontains("abc123")
true
response.body_string.icontains("abc124")
true
response.body_string.icontains("ASD123")
true
Was this page helpful?
