我试图理解为什么这个总是会返回,“它将被停止”:
def test = "started"
if (test ==~ "deallocated"||"stopped") {
println "it will be stopped"
}我对groovy还很陌生,而且还在学习,如果条件不起作用,我就不明白为什么。
发布于 2022-10-06 08:43:08
matcher中的OR应该看起来像:
def test = "stopped"
if (test ==~ "deallocated|stopped") {
println "it will be stopped"
}https://stackoverflow.com/questions/73970792
复制相似问题