Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/heimdallrj/string-prototype

A modified JS `String` Object -- DEPRICATED. Use `js-prototype` instead!
https://github.com/heimdallrj/string-prototype

javascript js

Last synced: 1 day ago
JSON representation

A modified JS `String` Object -- DEPRICATED. Use `js-prototype` instead!

Awesome Lists containing this project

README

        

# string-prototype

A modified JS `String.prototype` Object.

## Installation

```
npm install string-prototype
```

## Usage

### String.allReplace()

```
import 'string-prototype';

var str = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';

var list = {
'ipsum': 'REPLACED-ipsum',
'amet': 'REPLACED-amet'
};
var newStr = str.allReplace(list);
console.log(newStr); // Lorem REPLACED-ipsum dolor sit REPLACED-amet, consectetur adipiscing elit.
```

### String.toTitleCase()

```
import 'string-prototype';

var str = 'Lorem ipsum dolor';
var result = str.toTitleCase();
console.log(result); // Lorem Ipsum Dolor

```