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

166
Vistas
Better way to replace dot(.) with comma(,) only in specific part of the string
var a = '<span class="test">33.3;34.55</span><img src="../../../test.gif" onclick=testThis(''open'')><span class="test">33.3;34.55</span><img src="../../../test.gif" onclick=testThis(''open'')>0.22';

Here, I need to replace dots in all parts of the string except in src and onclick. I have used two for loops to replace these tags and data with a placeholder. And replaced all dot with comma.

'<span class="test">33,3;34,55</span><img src=src_ph onclick=onclick_ph><span class="test">33,3;34,55</span><img src=src_ph onclick=onclick_ph>0,22';

But now I need those tags and data again. For this I have to make use of forloop again. Is there better solution? Thanks

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