Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

122
Vistas
How to ignore special chars?

Assume the following code:

var text = "John\nDoe";
console.log(text);

I end up with two lines...

John
Doe

The variable text is passed into my function as a call to a web service, but the special chars are interpreted as a carriage return which breaks my hashing algorithms. They are not interpreted as standard chars and giving bad hash values.. How do I get node.js to interpret them as literals?

I have no control over the values passed in. Simply typing a double backslash is not an option.

I do not wish to remove all line breaks. I want the line breaks to be string literals. I want the \n as as string literal, and not be removed.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda