Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandro-ooo authored Mar 14, 2023
1 parent cddf021 commit 9802245
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,24 @@
- Easy
- Typescript 4.9.5

### Scripts
### Functions

#### `todo`
## `hasBannedWords(text: string): boolean`
checks if a word or a long text contains banned words.
```ts
hasBannedWords("Badword");
// Output: true

hasBannedWords("Hello world!");
// Output: false

```
## `redactBannedWords(text: string, censor: string = "******"): string`
```ts
console.log(redactBannedWords("Leave this badword outta my badwording face!"));
// Output: Leave this ***** outta my ***** face!

console.log(redactBannedWords("Leave this badword outta my badwording face!", "[REDACTED]"));
// Output: Leave this [REDACTED] outta my [REDACTED] face!

```

0 comments on commit 9802245

Please sign in to comment.