Skip to content

Instantly share code, notes, and snippets.

@AkatQuas
Created November 1, 2019 06:07
Show Gist options
  • Save AkatQuas/09c8664ec22b50fff1021bc3fd2662f5 to your computer and use it in GitHub Desktop.
Save AkatQuas/09c8664ec22b50fff1021bc3fd2662f5 to your computer and use it in GitHub Desktop.
Adding zero-space width character to the text (string)
/**
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