I have a string that I've pulled in from a text area as a string, I've done:
Then I through it in an array, actually a couple sorting and resorting.Code:var punct_less = s.replace(/[\.,-\/#!$%\^&\*;:{}=\-_`~()]/g,""); var finalString = punct_less.replace(/\s{2,}/g,"");
Then I finally took the array and used toString() on it and then I have tried every permutation of .replace() to pull the commas out of the rather large string with no success. My latest attempt was:
Could someone give me some guidance here? I've messed with reg exp as you can see up top...someone where when I split or toString it added all these commas. Thanks a lot peopleCode:inalstr = final.toString(); finalstr.replace(/,/g, ' ');


Reply With Quote

Bookmarks