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
Solved

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

Posted on 2011-02-27
10
3,681 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Iteration Help (Asp.net VB) 5 24
Troubles viewing HTML in Outlook 2010 client 3 28
Media Queries  not Firing 6 17
Html Newline 7 20
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

791 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