Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

126
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda