Solved

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

Posted on 2011-02-27
10
3,630 Views
Last Modified: 2012-08-14
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
Comment
Question by:kwh3856
  • 7
  • 3
10 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 34992695
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
 

Author Comment

by:kwh3856
ID: 34992711
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
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 34992724
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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Author Comment

by:kwh3856
ID: 34992727
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
 

Author Comment

by:kwh3856
ID: 34992734
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
 

Author Comment

by:kwh3856
ID: 34992740
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
 

Accepted Solution

by:
kwh3856 earned 0 total points
ID: 34992804
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
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 34992809
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
 

Author Comment

by:kwh3856
ID: 35160915
Figured out the solution myself.
0
 

Author Closing Comment

by:kwh3856
ID: 35187467
Fixed problem myself...
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question