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

168
Views
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
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!