Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/sajjadmrx/best-string
- Owner: sajjadmrx
- Created: 2022-08-13T12:21:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-13T12:56:06.000Z (over 2 years ago)
- Last Synced: 2024-10-29T10:18:59.668Z (3 months ago)
- Topics: javascript, regex, rtl, string, string-manager, typescript
- Language: TypeScript
- Homepage:
- Size: 24.4 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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