在groovy中有一种从集合中删除值的特定方法。例如,我有一个表单字段列表,但其中两个是隐藏字段,我试图弄清楚如何从集合中删除它们。我要删除的两个参数是 salesKey 和 topicSelection 。 Groovy新手所以代码示例是最有帮助的
request.requestParameterMap.collect { key, value -> "$key: ${value[0].string}" }.join("\n")
key.remove("salesKey")
key.remove("topicSelection")