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
clapton-0.0.1 lib/clapton/javascripts/node_modules/lodash/replace.js
immosquare-cleaner-0.1.47 node_modules/lodash/replace.js
immosquare-cleaner-0.1.46 node_modules/lodash/replace.js
immosquare-cleaner-0.1.45 node_modules/lodash/replace.js
immosquare-cleaner-0.1.44 node_modules/lodash/replace.js
boring_generators-0.14.0 tmp/templates/app_template/node_modules/lodash/replace.js
immosquare-cleaner-0.1.43 node_modules/lodash/replace.js
immosquare-cleaner-0.1.42 node_modules/lodash/replace.js
immosquare-cleaner-0.1.41 node_modules/lodash/replace.js
immosquare-cleaner-0.1.40 node_modules/lodash/replace.js
sumomo-0.10.8 data/sumomo/api_modules/node_modules/lodash/replace.js
immosquare-cleaner-0.1.39 node_modules/lodash/replace.js
immosquare-cleaner-0.1.38 node_modules/lodash/replace.js
optimacms-0.1.61 spec/dummy/node_modules/lodash/replace.js
boring_generators-0.13.0 tmp/templates/app_template/node_modules/lodash/replace.js
immosquare-cleaner-0.1.32 node_modules/lodash/replace.js
immosquare-cleaner-0.1.31 node_modules/lodash/replace.js
immosquare-cleaner-0.1.30 node_modules/lodash/replace.js
immosquare-cleaner-0.1.29 node_modules/lodash/replace.js
immosquare-cleaner-0.1.28 node_modules/lodash/replace.js