Created
November 1, 2019 06:07
-
-
Save AkatQuas/09c8664ec22b50fff1021bc3fd2662f5 to your computer and use it in GitHub Desktop.
Adding zero-space width character to the text (string)
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
/** | |
The zero-width space character is encoded in Unicode as U+200B ZERO WIDTH SPACE (HTML ​) | |
*/ | |
function insertSpaces(string){ | |
return Array.from(string).join('\u200b'); | |
} | |
// see more at https://en.wikipedia.org/wiki/Zero-width_space | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment