Nodejs String Replace replaceAll(AFindText, ARepText)

Here you can find the source of replaceAll(AFindText, ARepText)

Method Source Code

/**// w ww.  j a v a 2s .  co  m
 * Created by uv2sun on 15/12/24.
 */
String.prototype.replaceAll = function (AFindText, ARepText) {
    return this.replace(new RegExp(AFindText, "gm"), ARepText)
};

Related

  1. replaceAll( token, newToken, ignoreCase )
    String.prototype.replaceAll = function( token, newToken, ignoreCase ) {
        var _token;
        var str = this + "";
        var i = -1;
        if ( typeof token === "string" ) {
            if ( ignoreCase ) {
                _token = token.toLowerCase();
                while( (
                    i = str.toLowerCase().indexOf(
    ...
    
  2. replaceAll( token, newToken, ignoreCase )
    String.prototype.replaceAll = function( token, newToken, ignoreCase ) {
        var _token;
        var str = this + "";
        var i = -1;
        if ( typeof token === "string" ) {
            if ( ignoreCase ) {
                _token = token.toLowerCase();
                while( (
                    i = str.toLowerCase().indexOf(
    ...
    
  3. replaceAll($oldText,$replaceText)
    String.prototype.replaceAll = function($oldText,$replaceText){
      return this.replace(new RegExp($oldText,"gm"),$replaceText);
    };
    
  4. replaceAll()
    String.prototype.replaceAll = function() {
        var target = this;
        return target.split(" ").join("-");
    };
    String.prototype.numberToString = function() {
        var target = this;
        var storing = "";
        var strlength = target.length;
        var numbers = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"];
    ...
    
  5. replaceAll(AFindText, ARepText)
    String.prototype.replaceAll = function(AFindText, ARepText) {
        var raRegExp = new RegExp(AFindText, "g");
        return this.replace(raRegExp, ARepText);
    };
    
  6. replaceAll(_old, _new)
    String.prototype.replaceAll = function(_old, _new){
        return this.replace(new RegExp(_old, 'g'), _new)
    };
    
  7. replaceAll(a, b)
    String.prototype.replaceAll = function(a, b) {
        var toReturn = this;
        var temp;
        do {
            temp = toReturn;
        } while(
            (toReturn = toReturn.replace(a, b)) !== temp
        );
        return toReturn;
    ...
    
  8. replaceAll(de, para)
    String.prototype.replaceAll = function (de, para) {
      var str = this;
      var pos = str.indexOf(de);
      while (pos > -1) {
        str = str.replace(de, para);
        pos = str.indexOf(de);
      return (str);
    };
    ...
    
  9. replaceAll(exp, newStr)
    String.prototype.replaceAll = function (exp, newStr) {
        return this.replace(new RegExp(exp, "gm"), newStr);
    };