Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
120
rated 0 times [  125] [ 5]  / answers: 1 / hits: 120811  / 15 Years ago, thu, june 4, 2009, 12:00:00

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?


More From » arrays

 Answers
32

Yes.



for(var i=0; i < arr.length; i++) {
arr[i] = arr[i].replace(/,/g, '');
}

[#99374] Wednesday, June 3, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
monetm

Total Points: 615
Total Questions: 103
Total Answers: 119

Location: Finland
Member since Fri, Oct 21, 2022
2 Years ago
monetm questions
Fri, Feb 26, 21, 00:00, 3 Years ago
Wed, Sep 9, 20, 00:00, 4 Years ago
Sun, Jul 26, 20, 00:00, 4 Years ago
Thu, Jun 11, 20, 00:00, 4 Years ago
;