目標(biāo)是把每個(gè)元素中的null字符串替換成下個(gè)元素,最終得到一個(gè)替換好的字符串。相關(guān)代碼// list數(shù)組如下var list = [ "data : {null}",
"item : ( payload.data.list map(value0, index0) -> {null})", "gradeList : ( value0.gradeList map(value1, index1) -> {null})",
"otherList : ( value1.otherList map(value2, index2) -> {null})",
"anotherList : ( value2.anotherList map(value3, index3) -> {null})"]所需結(jié)果是一個(gè)字符串 "data : { item : ( payload.data.list map(value0, index0) -> {
gradeList : ( value0.gradeList map(value1, index1) -> {
otherList : ( value1.otherList map(value2, index2) -> {
anotherList : ( value2.anotherList map(value3, index3) -> {null})
})
})
})
}"
字符串?dāng)?shù)組逐級(jí)替換問題
qq_遁去的一_1
2019-03-07 16:27:59