Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8171565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:30:03+00:00 2026-06-06T21:30:03+00:00

I take user-input (JS code) and execute (process) them in realtime to show some

  • 0

I take user-input (JS code) and execute (process) them in realtime to show some output.

Sometimes the code has those zero-width spaces; it’s really weird. I don’t know how the users are inputting that. Example: "(​$".length === 3

I need to be able to remove that character from my code in JS. How do I do so? or maybe there’s some other way to execute that JS code so that the browser doesn’t take the zero-width space characters into account?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T21:30:04+00:00Added an answer on June 6, 2026 at 9:30 pm

    Unicode has the following zero-width characters:

    • U+200B zero width space
    • U+200C zero width non-joiner Unicode code point
    • U+200D zero width joiner Unicode code point
    • U+FEFF zero width no-break space Unicode code point

    To remove them from a string in JavaScript, you can use a simple regular expression:

    var userInput = 'a\u200Bb\u200Cc\u200Dd\uFEFFe';
    console.log(userInput.length); // 9
    var result = userInput.replace(/[\u200B-\u200D\uFEFF]/g, '');
    console.log(result.length); // 5
    

    Note that there are many more symbols that may not be visible. Some of ASCII’s control characters, for example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to take the user's input, respond to them, and then update some
I have some Java code like int userid = take user input; And then
I'd like to take user input (sometimes this will be large paragraphs) and generate
I am using a basiceditfield to take input from the user to do some
So I have some code here that takes user input from a standard web
I'd like to take some user input text and quickly parse it to produce
how to take user input in Array using Java? i.e we are not initializing
What if I want to take user input from the args[0] array, but just
I want to have a form on my page take user input, a URL
I am trying to using the JS to take user input and modify certain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.