Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
¿Cómo actualizar esta cadena JSON con \" para que pueda ser JSON.parse()?

Así que obtuve esta cadena JSON,

 { "Text": "<?xml version=\"1.0\"</pi>", "Type": "Checkin" }

Necesito deserializarlo de nuevo a un objeto.

 var returnedFileContent = '{"Text": "<?xml version=\"1.0\"</pi>","Type": "Checkin"}'; var test10 = JSON.parse(returnedFileContent); console.log(test10)

Error:

Número inesperado en JSON en la posición 25

Sé que a JS no le gusta \" y funcionará si la cadena JSON es:

 { "Text": "<?xml version=\\\\\\" 1.0\\\\\\ "</pi>", "Type": "Checkin" }

El problema es cómo convertir \" a \\\".

Nota: no tengo control de la cadena JSON de entrada.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!