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

273
Views
How to add attributes color, font-weight, font-style and text-align inside of c# and using method Replace

I have this piece of code:

enter else
{
    rowData = rowData.Equals("False") || rowData.Equals("True") ? rowData.Replace("False", "No").Replace("True", "Yes") : rowData;
    rowData = rowData.Replace("<img", $"<img width='{contentWidth}' height='100%' ");
    rowData = rowData.Replace("font-size:", "").Replace("font-family:", "");
    rowData = $"<div style= 'font-size:{builder.Font.Size}pt;font-family:{builder.Font.Name};'>{rowData}</div>";
    builder.InsertHtml(rowData);
} 

But, I need to make changes in attributes color, font-weight, font-style and text-align as well. For color, for example, I tried .Replace("color:","") and in the next line color:{builder.Font.Color};, but I did get it.

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!