Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/sajjadmrx/best-string

A package to manipulate string.
https://github.com/sajjadmrx/best-string

javascript regex rtl string string-manager typescript

Last synced: 3 months ago
JSON representation

A package to manipulate string.

Awesome Lists containing this project

README

        



Best-string Logo






A package to manipulate string.

## Instalation

use this command to installation

```
npm install best-string
```

## imports

```
import BestString from 'best-string' //or require
```

# Usage

```ts
import BestString from "best-string";

const my_text = new BestString('Hello alert("TEST")').noScriptTag().build()
console.log(my_text) //Result: 'Hello'

const text = new BestString('Hi چطوری؟').noRtlCharacters().build();
console.log(text) //Result: 'Hi'

const user = 'Jack'
const message = new BestString('welcome {user}! your role is ROLE!,your nickname is {user}')
.replaceGlobal('{user}', user)
.replaceGlobal('ROLE', 'ADMIN')
.build()
console.log(message) //Result: welcome Jack! your role is ADMIN!,your nickname is Jack
```

## TODO

- add Methods