Revision: 47621
Updated Code
at July 15, 2011 12:58 by StrawMan
Updated Code
//Remove every second comma only and replace with spaces and double colon.
function remComma(str) {
return str = str.replace(/(,[^,]*),/g, '$1 :: ');
}
//Remove all commas outside of html markup only.
function remAllComma(str) {
return str = str.replace(/,(?!([^<]+)?>)/g, '');
}
//Remove all commas, everywhere.
function remTotalComma(str) {
return str = str.replace(/,/g, '');
}
//Discard all square brackets from string.
function remSquareBrackets(str) {
return str = str.replace(/\[|\]/g, '');
}
Revision: 47620
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at June 11, 2011 13:16 by StrawMan
Initial Code
//Remove every second comma only and replace with spaces and double colon.
function remComma(str) {
return str = str.replace(/(,[^,]*),/g, '$1 :: ');
}
//Remove all commas outside of html markup only.
function remAllComma(str) {
return str = str.replace(/,(?!([^<]+)?>)/g, '');
}
//Remove all commas, everywhere.
function remTotalComma(str) {
return str = str.replace(/,/g, '');
}
Initial URL
Initial Description
Initial Title
String Manipulation - Regex Collection
Initial Tags
Initial Language
JavaScript