Replace string in javascript array

后端 未结 7 2185
萌比男神i
萌比男神i 2020-12-08 14:10

I have an array in javascript. This array has strings that contains commas (\",\"). I want all commas to be removed from this array. Can this be done?

7条回答
  •  清歌不尽
    2020-12-08 15:06

    Sure -- just iterate through the array and do a standard removal on each iteration.

    Or if the nature of your array permits, you could first convert the array to a string, take out the commas, then convert back into an array.

提交回复
热议问题