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.

Revisions

  1. AkatQuas created this gist Nov 1, 2019.
    9 changes: 9 additions & 0 deletions insert-space.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    /**
    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