1.0.0 • Published 5 years ago

@kingjs/string-ex.replace-all v1.0.0

Weekly downloads
2
License
MIT
Repository
-
Last release
5 years ago

@kingjs/string-ex.replace-all

Returns a new string in which all occurrences of a substring are replaced with another string.

Usage

var assert = require('assert');
var ReplaceAll = require('@kingjs/string-ex.replace-all');

var result = "fooBarFooBar"[ReplaceAll]('Bar', 'Moo');
assert(result == 'fooMooFooMoo');

API

replaceAll(this, oldValue, newValue)

Parameters

  • this: The string to search and replace.
  • oldValue: The string to be replaced.
  • newValue: The string to replace all occurrences of oldValue.

Returns

A string that is equivalent to the current string except that all instances of oldValue are replaced with newValue.

Install

With npm installed, run

$ npm install @kingjs/string-ex.replace-all

Source

https://repository.kingjs.net/string-ex/replace-all

License

MIT

Analytics