Karate 我怎样才能为“你”做空手道配对;任何数组项都以“开始”;在字符串数组上?

Karate 我怎样才能为“你”做空手道配对;任何数组项都以“开始”;在字符串数组上?,karate,Karate,假设我的“工作流结果”等于: ["START","Success : <0_4726310526.1228950033456.WEBSERVICES@random>","END"] 在空手道文档中找不到答案。给你: * def response = ["START","Success : <0_4726310526.1228950033456.WEBSERVICES@random>

假设我的“工作流结果”等于:

["START","Success : <0_4726310526.1228950033456.WEBSERVICES@random>","END"]
在空手道文档中找不到答案。

给你:

* def response = ["START","Success : <0_4726310526.1228950033456.WEBSERVICES@random>","END"]
* def fun = function(x){ return x.startsWith('Success') }
* def temp = karate.filter(response, fun)
* assert temp.length > 0
*def response=[“开始”,“成功”,“结束”]
*def fun=函数(x){return x.startsWith('Success')}
*def温度=空手道过滤器(响应,乐趣)
*断言临时长度>0

在空手道文档中找不到答案。
是,文档很烂。每个人都这么说。这些文件比一些好得多。但是,有一些边缘案例,比如这一个,没有直接记录。我不认为它值得一个“文档糟糕透顶”,文档永远不会覆盖所有的边缘案例。这就是堆栈溢出的作用
* def response = ["START","Success : <0_4726310526.1228950033456.WEBSERVICES@random>","END"]
* def fun = function(x){ return x.startsWith('Success') }
* def temp = karate.filter(response, fun)
* assert temp.length > 0