我有一個字串串列:
def parsed_list = ['29/29(100%)', '36/36(10%)', '32/32(100%)', '18/18(100%)', '18/18(100%)', '6/6(100%)']
我想提取百分比值:100%、100%、100%、100%、100%、100%
我正在嘗試使用這些代碼:
def percentages = parsed_list*.find(/\d %/)
但我得到這個錯誤:spread not yet supported for CPS transformation
我應該改進什么?
uj5u.com熱心網友回復:
嘗試不使用擴展運算子
parsed_list.collect{it.find(/\d %/)}
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/489952.html
