我想用“trim()”更改这些元素的值。
“this.currentPaaas.Requisicion.RefCFinancingFirst [0] = this.currentPaaas.Requisicion [0] .RefCFinancingForm.trim();”
“this.currentPaaas.Requisicion [0] .RefCObjetoGasto = this.currentPaaas.Requisicion [0] .RefCObjetoGasto.trim();”
但它们在数组中,我这样做只会改变数组中的单个值。如何更改该数组中的所有值?
currentPaaas包含数组Requisicion []
根据问题中的陈述,我认为你要做的是修剪currentPaaas中每个元素的RefCFinancingForm?
如果是,那就是你需要的:this.currentPaaas.Requisicion.forEach(x => x.RefCFinancingForm = x.RefCFinancingForm.trim())