Skip to content

Instantly share code, notes, and snippets.

@hachesilva
Created February 21, 2018 16:14
Show Gist options
  • Save hachesilva/87cbd2b499e08d66a6acac16bc17d373 to your computer and use it in GitHub Desktop.
Save hachesilva/87cbd2b499e08d66a6acac16bc17d373 to your computer and use it in GitHub Desktop.
var content = 'MY TEXT WITH INVISIBLE CHARS';
if (content.search(/[^\u0000-\u007E]/g) >= -1) {
content.replace(/[^\u0000-\u007E]/g, "");
this.code.set(content);
}
@trevlar
Copy link

trevlar commented Apr 21, 2023

This removes visible characters such as emojis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment