Nodejs Utililty Methods String Remove

List of utility methods to do String Remove

Description

The list of methods to do String Remove are organized into topic(s).

Method

removeChar(character)
String.prototype.removeChar = function (character) {
      return this.replaceAll(character, "");
removeCharacters()
String.prototype.removeCharacters = function() {
  var twoStrings = this.split(", "),
  array2 = twoStrings[1],
  array1= twoStrings[0],
  temp = "";
  for (var i = 0, length = array2.length; i < length; i++) {
    for (var j = 0, l = array1.length; j < l; j++) {
      if (array1[j] == array2[i]) {
        array1 = array1.remove(j);
...
removeChars()
String.prototype.removeChars = function () {
      varReturnStr = "" ;
      for ( var inx = 0 ; inx < this.length ; inx++ ) {
          if ( this.substring( inx, inx+1 ) != "-")
                      varReturnStr = varReturnStr + this.substring( inx, inx+1 ) ;
      return varReturnStr;
removeClasses(s)
String.prototype.removeClasses = function(s)
    return this.replace(/style="[^"]*"|class="[^"]*"/gi, "");
removeComma()
String.prototype.removeComma = function() {
    return(this.replace(/,/g,''));
removeDiacritics()
String.prototype.removeDiacritics = function() {
    var result = this.replace(/i/g, 'i')
                .replace(/?/, 'c');
    return result;
removeDots()
String.prototype.removeDots = function() {
  return this.replace(/\./g, '');
};
removeEndLine()
String.prototype.removeEndLine = function() {
    var tmp = "";
    for(var i = 0, length = this.length; i < length; i++) {
        var c = this.charAt(i);
        if(c != "\n" && c != "\r") {
            tmp += c;
    return tmp;
...
removeFileExtension()
String.prototype.removeFileExtension = function()
    var re = /(.*)\.[^.]+$/;
    return re.test(this);
removeFromList(c)
String.prototype.removeFromList=function(c){
  var arr=this.split(c), i=1;
  for(;i<arguments.length;i++) delete arr[arguments[i]-1];
  return arr.filter(function(v){return v!==undefined}).join(c);