?
Solved

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

Posted on 2011-02-27
10
Medium Priority
?
4,023 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

 

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

752 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