Identify, remove, replace, and count profanities within a string or an array of strings.
npm install profanity-list> Identify, remove, replace, and count profanities within a string or an array of strings.
``sh`
npm install profanity-list
#### hasSwearWord
`sh
import profanity from 'profanity-list';
profanity.hasSwearWord("this fucking sucks."); //true
profanity.hasSwearWord("Today has been great!"); //false
profanity.hasSwearWord(["Today has been great!", "I hate this shit"]); //false
profanity.hasSwearWord(["Today has been great!", "I'm so happy"]); //true
``
#### numberOfSwearssh
import profanity from 'profanity-list';
profanity.numberOfSwears("this shit fucking sucks."); //2
profanity.numberOfSwears("Today has been great!"); //0
profanity.numberOfSwears(["Today has been great!", "I hate this shit"]); //[0, 1]
profanity.numberOfSwears(["What the fuck!", "This shit fucking sucks."]); //[1, 2]
``
#### removeSwearssh
import profanity from 'profanity-list';
profanity.removeSwears("this shit fucking sucks."); //this shit * sucks.
profanity.removeSwears("Today has been great!"); //Today has been great!
profanity.removeSwears(["Today has been great!", "I hate this shit"]); //["Today has been great!", "I hate this **"]
profanity.removeSwears(["What the fuck!", "This shit fucking sucks."]); //["What the *!", "This sucks."]
``
š¤ Kohl Byrd
* Website: kohlbyrd.com
* Twitter: @byrd\_kohl
* Github: @Limeslices
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a āļø if this project helped you!
*
_This README was generated with ā¤ļø by readme-md-generator_