Sha256: 008cf42308400e8ef434dba25c1803d5611b887948e4664ef986cdc7d7e481ad

Contents?: true

Size: 754 Bytes

Versions: 275

Compression:

Stored size: 754 Bytes

Contents

var toString = require('./toString');

/**
 * Replaces matches for `pattern` in `string` with `replacement`.
 *
 * **Note:** This method is based on
 * [`String#replace`](https://mdn.io/String/replace).
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category String
 * @param {string} [string=''] The string to modify.
 * @param {RegExp|string} pattern The pattern to replace.
 * @param {Function|string} replacement The match replacement.
 * @returns {string} Returns the modified string.
 * @example
 *
 * _.replace('Hi Fred', 'Fred', 'Barney');
 * // => 'Hi Barney'
 */
function replace() {
  var args = arguments,
      string = toString(args[0]);

  return args.length < 3 ? string : string.replace(args[1], args[2]);
}

module.exports = replace;

Version data entries

275 entries across 273 versions & 31 rubygems

Version Path
immosquare-cleaner-0.1.60 node_modules/lodash/replace.js
immosquare-cleaner-0.1.59 node_modules/lodash/replace.js
immosquare-cleaner-0.1.58 node_modules/lodash/replace.js
immosquare-cleaner-0.1.57 node_modules/lodash/replace.js
immosquare-cleaner-0.1.56 node_modules/lodash/replace.js
immosquare-cleaner-0.1.55 node_modules/lodash/replace.js
immosquare-cleaner-0.1.54 node_modules/lodash/replace.js
immosquare-cleaner-0.1.53 node_modules/lodash/replace.js
immosquare-cleaner-0.1.52 node_modules/lodash/replace.js
trusty-cms-6.3.1 node_modules/lodash/replace.js
immosquare-cleaner-0.1.51 node_modules/lodash/replace.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/replace.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/replace.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/replace.js
immosquare-cleaner-0.1.50 node_modules/lodash/replace.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/replace.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/replace.js
clapton-0.0.22 lib/clapton/javascripts/node_modules/lodash/replace.js
clapton-0.0.21 lib/clapton/javascripts/node_modules/lodash/replace.js
clapton-0.0.20 lib/clapton/javascripts/node_modules/lodash/replace.js