Created
February 28, 2023 08:46
-
-
Save tzwel/042ac485152a28161617fc922c7e7324 to your computer and use it in GitHub Desktop.
last resort empty string validation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"is this string empty?" | |
.replace(/[ ㅤ]/g, '') | |
.replace(/\r?\n|\r/g, '') | |
.replace(/<\/?[^>]+(?:>|$)?/g, '').trim().length === 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment