• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4408
  • Last Modified:

Bold format character </b> not being recognized in string.Format command

I am trying to turn off bold in a character string but for some reason it is ignoring my command.  This data is stored in a variable and then assinged to a web based HTML editor.  Can someone point me in the right direction?

Here is the raw output in the editor:

<BR><BR><FONT color=blue><B>Physical Exam</B></FONT><BR>
</B>EyesLeft pupil: reactive to light<BR></B>
// Concantenate PE Array
                        int PEsecondindex;
                        MyGlobalVars.PEConCat = "<br /><br /><font color=blue><b>Physical Exam</b></font><br />";
                        for (PEsecondindex = 0; PEsecondindex < MyGlobalVars.PECount; PEsecondindex++)
                        {
                            MyGlobalVars.PEConCat = string.Format("<b>{0}</b>{1}<br />", MyGlobalVars.PEConCat, MyGlobalVars.PE[PEsecondindex]);
                        }

Open in new window

0
kwh3856
Asked:
kwh3856
  • 7
  • 3
1 Solution
 
Carl TawnSystems and Integration DeveloperCommented:
What do you mean by "turn of bold"? If you don't want the text to be bold you need to remove the <b> and </b> tags surrounding the currently bold text.
0
 
kwh3856Author Commented:
Currenty the output in the HTML editor look like this

Physical Exam
EyesLeft pupil: reactive to light


I need the output to look like this
Physical Exam
EyesLeft pupil: reactive to light
0
 
Carl TawnSystems and Integration DeveloperCommented:
Can you post the resulting HTML? There isn't anything in the snippet you posted that would suggest that "reactive to light" should be appearing in bold.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
kwh3856Author Commented:
I have tried to do that here

("<b>{0}</b>{1}<br />"


I turn on the bold at the beginning of the first field, then turn it off, then display the next field.
0
 
kwh3856Author Commented:
here is the entire output of the HTML editor in RAW mode:

By the way, I am using an Infragistics HTML editor if that makes a difference.



<B><FONT color=blue>Chief Complaint</B></FONT><BR>neck pain/ cervical radiculopathy46 yr old female Post OP F/UP per dr alexander c/o neck pain radiate to bilat shoulders <BR><BR><FONT color=blue><B>Medications</B></FONT><BR>Lunesta 3 mg Tab <B>Rx Strength = </B>3 <B>Take = </B>3 <B>Frequency = </B><B>Duration = </B><B>Dispense = </B><B>Refills = </B>1 <BR>Allegra D <B>Rx Strength = </B>60 mg <B>Take = </B>1 tab <B>Frequency = </B>bid <B>Duration = </B>60 <B>Dispense = </B><B>Refills = </B><BR>Clarinex <B>Rx Strength = </B>5 mg <B>Take = </B>1 tab(s) <B>Frequency = </B>once a day <B>Duration = </B>30 <B>Dispense = </B><B>Refills = </B><BR>Vioxx <B>Rx Strength = </B>25 mg <B>Take = </B>1 tab <B>Frequency = </B>qd <B>Duration = </B><B>Dispense = </B><B>Refills = </B><BR>lipitor <B>Rx Strength = </B>10mg <B>Take = </B>as directed <B>Frequency = </B>daily <B>Duration = </B><B>Dispense = </B><B>Refills = </B><BR><BR><BR><B><FONT color=blue>Allergies</B></FONT><BR>Coumadin <B>Drug Allergy:</B> <B>Reaction:</B> rash<BR>Lipitor <B>Drug Allergy:</B> <B>Reaction:</B> <BR>MORPHINE AND RELATED <B>Drug Allergy:</B> <B>Reaction:</B> unknown<BR>* No known food allergies <B>Drug Allergy:</B> <B>Reaction:</B> <BR>MORPHINE AND RELATED <B>Drug Allergy:</B> <B>Reaction:</B> unknown<BR><BR><BR><B><FONT color=blue>Diagnosis</B></FONT><BR>Gastrointestinal bleeding NOS<B> Diagnosis Notes:</B><B> Onset Date:</B>1/1/1753 12:00:00 AM<BR>Gastroesophageal reflux disease<B> Diagnosis Notes:</B>Medical therapy begun<B> Onset Date:</B>1/1/1753 12:00:00 AM<BR>Bacteremia<B> Diagnosis Notes:</B><B> Onset Date:</B>1/1/1753 12:00:00 AM<BR>Asthma<B> Diagnosis Notes:</B><B> Onset Date:</B><BR><BR><BR><BR><B><FONT color=blue>HPI</B></FONT><BR>neck pain/ cervical radiculopathy <B>Description:</B> <B>Notes:</B><BR><B>Description:</B>Fever <B>Notes:</B>low grade<BR><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><BR><BR><FONT color=blue><B>Physical Exam</B></FONT><BR></B>EyesLeft pupil: reactive to light<BR></B>IntegumentBack palpation: non-tender<BR></B>IntegumentFinger palpation: non-tender<BR></B>IntegumentAbdomen palpation: non-tender<BR></B>IntegumentCalf palpation: non-tender<BR></B>IntegumentCalf palpation: soft<BR></B>IntegumentKnee palpation: non-tender<BR></B>MS: head/neckDeformities: no deformities<BR></B>MS: head/neckFlexion: full range on flexiion<BR></B>MS: head/neckCervical stability: no laxity<BR></B>MS: head/neckHead: normocephalic<BR></B>MS: left lower extremityHamstrings (S1), tibial nerve: 5/5 strength for all maneuvers<BR></B>MS: left lower extremityEHL (L5), deep peroneal nerve: flexion weakness with 4/5 strength<BR></B>MS: right lower extremitycalf tone: normal tone<BR></B>MS: right lower extremityKnee: no limp<BR></B>MS: right upper extremityPhalen's: negative<BR></B>MS: right upper extremityElbow: full range of motion<BR></B>MS: right upper extremityWrist: normal appearance<BR></B>MS: right upper extremityElbow: full range of motion<BR></B>NeurologicalAlertness: alert and oriented x3<BR></B>NeurologicalRight (graded 0-4+ with 2+ being normal): all testable reflexes normal<BR></B>PsychiatricAffect: a normal exam<BR></B>RespiratoryRight lower lung field: a normal exam<BR><BR><BR><B><FONT color=blue>PFSH</B></FONT><BR>Marital status Married<BR>Number of children 2<BR>Number of cigarettes/day 20 (One Pack)<BR>Number of years using tobacco 15<BR><BR>
0
 
kwh3856Author Commented:
Here is additional code if this helps

foreach (var PErec in PEResult)
                    {
                        int PEcount = PEResult.Count();
                        MyGlobalVars.PECount = PEcount;
                        string[] PEarray = new string[PEcount];

                        int PEindex = 0;

                        foreach (var PEdatarec in PEResult)
                        {

                            PEarray[PEindex] = PEdatarec.PEdata.SystemName + PEdatarec.PEdata.SymptomName + "   "  + PEdatarec.PEdata.DescriptionName;

                            MyGlobalVars.PE[PEindex] = PEarray[PEindex];

                            PEindex++;

                        }


                        // Concantenate PE Array
                        int PEsecondindex;
                        MyGlobalVars.PEConCat = "<br /><br /><font color=blue><b>Physical Exam</b></font><br />";
                        for (PEsecondindex = 0; PEsecondindex < MyGlobalVars.PECount; PEsecondindex++)
                        {
                            MyGlobalVars.PEConCat = string.Format("<b>{0}</b>{1}<br />", MyGlobalVars.PEConCat, MyGlobalVars.PE[PEsecondindex]);
                        }

                    }






                    WebHtmlEditor1.Text = string.Format("{0}{1}{2}{3}{4}{5}{6}{7}<br />", MyGlobalVars.ChiefComplaint, MyGlobalVars.ChiefComplaintNote, MyGlobalVars.RxConCat, MyGlobalVars.AllergyConCat, MyGlobalVars.DiagnosisConCat, MyGlobalVars.HPIConCat, MyGlobalVars.PEConCat, MyGlobalVars.PFSHConCat);


0
 
kwh3856Author Commented:
Problem solved:

had to include the bolding in the building of the array.

 foreach (var PEdatarec in PEResult)
                        {

                            PEarray[PEindex] = "<b>" + PEdatarec.PEdata.SystemName + PEdatarec.PEdata.SymptomName + "</b>" + PEdatarec.PEdata.DescriptionName;

                            MyGlobalVars.PE[PEindex] = PEarray[PEindex];

                            PEindex++;

                        }


                        // Concantenate PE Array
                        int PEsecondindex;
                        MyGlobalVars.PEConCat = "<br /><br /><font color=blue><b>Physical Exam</b></font><br />";
                        for (PEsecondindex = 0; PEsecondindex < MyGlobalVars.PECount; PEsecondindex++)
                        {
                            MyGlobalVars.PEConCat = string.Format("{0}{1}<br />", MyGlobalVars.PEConCat, MyGlobalVars.PE[PEsecondindex]);
                        }
0
 
Carl TawnSystems and Integration DeveloperCommented:
Well, your output markup is extremely baddly formed, but it doesn't look like the snippet you posted is the culprit (although that depends partly on what MyGlobalVars.PE[PEsecondindex] is outputting).

It is the problems with the badly formatted markup that is causing the problem, and the browser is just interpreting it as best it can.
0
 
kwh3856Author Commented:
Figured out the solution myself.
0
 
kwh3856Author Commented:
Fixed problem myself...
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 7
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now