函数原型
func (s1 string) versionLess(s2 string) bool
参数介绍
举例
-
Response
-
匹配语句:
"(?P<version>\\d\\.\\d\\.\\d\\.)".submatch(response.body_string)["version"].versionLess("1.8.2") -
输出结果:
true
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
versionLess函数主要是用来比较一个版本字符串是否小于所给出的版本字符串
func (s1 string) versionLess(s2 string) bool
| 参数名称 | 参数介绍 |
|---|---|
| s1 | 需要进行比较的版本字符串 |
| s2 | 需要进行判断的版本字符串 |
| 待转换数据 | 转换语句 | 输出结果 |
|---|---|---|
1.8.1 | "1.8.1".versionLess("1.8.2") | true |
1.8.1.1-alpha | "1.8.1.1-alpha".versionLess("1.8.1-alpha") | false |
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: 85
<!DOCTYPE html>
<html>
<head>
<title>123</title>
</head>
<body>
1.8.1
</body>
</html>
"(?P<version>\\d\\.\\d\\.\\d\\.)".submatch(response.body_string)["version"].versionLess("1.8.2")
true
Was this page helpful?
