Oct 10, 2005 #1 brownfox Programmer Jan 5, 2003 173 GB How do I use replace() to remove all commas from string. Code: var my_string = "This is a string, it has a comma"; my_string = my_string.replace(",",""); ? T.I.A
How do I use replace() to remove all commas from string. Code: var my_string = "This is a string, it has a comma"; my_string = my_string.replace(",",""); ? T.I.A
Oct 10, 2005 1 #2 elegidito Programmer Jan 19, 2002 358 Code: var my_string = "This is a string, it has a comma"; my_string = my_string.replace(/,/g,""); "It is the mark of an educated mind to be able to entertain a thought without accepting it." - Aristotle Upvote 0 Downvote
Code: var my_string = "This is a string, it has a comma"; my_string = my_string.replace(/,/g,""); "It is the mark of an educated mind to be able to entertain a thought without accepting it." - Aristotle
Oct 11, 2005 Thread starter #3 brownfox Programmer Jan 5, 2003 173 GB Doesn't work, try it yourself. Error: This object doesn't support this property or method! Upvote 0 Downvote
Oct 11, 2005 Thread starter #4 brownfox Programmer Jan 5, 2003 173 GB My apologies it did work, I'm using an array not a string, that's why there were commas. Thanks for the tip. Star awarded! Upvote 0 Downvote
My apologies it did work, I'm using an array not a string, that's why there were commas. Thanks for the tip. Star awarded!