Removes from a string rare symbols - Node.js String

Node.js examples for String:String Value

Description

Removes from a string rare symbols

Demo Code


/**//from  w  w w .  j  a  v  a2  s .c om
 * Removes from a string rare symbols.
 *
 * @param {String} _ a string to be cleaned
 * @return {String} the provided string without rare symbols
 */
stringCleaner = function (_) {
  return _.replace(/[.*+?#^=!:${}()|\[\]\s\/\\]/g, "_");
};

Related Tutorials