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.27 node_modules/lodash/replace.js
immosquare-cleaner-0.1.26 node_modules/lodash/replace.js
immosquare-cleaner-0.1.25 node_modules/lodash/replace.js
immosquare-cleaner-0.1.24 node_modules/lodash/replace.js
immosquare-cleaner-0.1.23 node_modules/lodash/replace.js
sumomo-0.10.4 data/sumomo/api_modules/node_modules/lodash/replace.js
sumomo-0.10.3 data/sumomo/api_modules/node_modules/lodash/replace.js
sumomo-0.10.2 data/sumomo/api_modules/node_modules/lodash/replace.js
sumomo-0.10.1 data/sumomo/api_modules/node_modules/lodash/replace.js
sumomo-0.10.0 data/sumomo/api_modules/node_modules/lodash/replace.js
reed_sdk-1.0.1 node_modules/lodash/replace.js
reed_sdk-1.0.0 node_modules/lodash/replace.js
boring_generators-0.12.0 tmp/templates/app_template/node_modules/lodash/replace.js
sumomo-0.9.0 data/sumomo/api_modules/node_modules/lodash/replace.js
sumomo-0.8.22 data/sumomo/api_modules/node_modules/lodash/replace.js
sumomo-0.8.21 data/sumomo/api_modules/node_modules/lodash/replace.js
sumomo-0.8.20 data/sumomo/api_modules/node_modules/lodash/replace.js
sumomo-0.8.17 data/sumomo/api_modules/node_modules/lodash/replace.js
sumomo-0.8.16 data/sumomo/api_modules/node_modules/lodash/replace.js
disco_app-0.18.0 test/dummy/node_modules/lodash/replace.js