Click here to Skip to main content
15,885,069 members
Home / Discussions / C#
   

C#

 
GeneralRe: \r\n to Pin
Xmen Real 14-May-10 6:24
professional Xmen Real 14-May-10 6:24 
GeneralRe: \r\n to Pin
PIEBALDconsult14-May-10 6:37
mvePIEBALDconsult14-May-10 6:37 
GeneralRe: \r\n to Pin
Xmen Real 14-May-10 6:41
professional Xmen Real 14-May-10 6:41 
GeneralRe: \r\n to Pin
AspDotNetDev14-May-10 9:28
protectorAspDotNetDev14-May-10 9:28 
GeneralRe: \r\n to Pin
Xmen Real 14-May-10 18:26
professional Xmen Real 14-May-10 18:26 
GeneralRe: \r\n to Pin
AspDotNetDev14-May-10 18:28
protectorAspDotNetDev14-May-10 18:28 
GeneralRe: \r\n to Pin
Xmen Real 14-May-10 18:30
professional Xmen Real 14-May-10 18:30 
GeneralRough solution but works Pin
Xmen Real 14-May-10 18:59
professional Xmen Real 14-May-10 18:59 
You may laugh on it, or say its a bad way to do but what can I do ? I have only this that works

string[] htmlLines = @"<h1>Heading 1</h1>
<p>Some paras</p>

<br />
<hr />
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
<img src=""/somedirectory/abcd.png"" />
Some asdfdhjfsdkhfjk cxmvnxc,vm n,mnjshkj fsdf sdfklj xvxcvxc vx <code>asdajsdklas jdlkdalkl</code> xcjvkflj
sdf
sdf
sd
fsd
fsf
cv".Split('\n');

string[] ignoreEnds = new string[] { "ol>", "ul>", "li>", "hr />", "br />", "h1>", "h2>", "h3>", "h4>", "h5>", "h6>" };
System.Text.StringBuilder sb = new System.Text.StringBuilder();
for (int a = 0; a < htmlLines.Length; a++)
{
string newLine = htmlLines[a].TrimEnd('\r');

bool appendBr = true;
for (int b = 0; b < ignoreEnds.Length; b++)
{
if (newLine.EndsWith(ignoreEnds[b]))
{
appendBr = false;
break;
}
}
if (appendBr)
newLine += "<br />";
else
newLine += "\r\n";
sb.Append(newLine);
}

string html = sb.ToString();
GeneralRe: Rough solution but works Pin
AspDotNetDev17-May-10 17:02
protectorAspDotNetDev17-May-10 17:02 
GeneralRe: Rough solution but works Pin
Xmen Real 17-May-10 18:07
professional Xmen Real 17-May-10 18:07 
QuestionExtending Entity Data Model Pin
Sevententh14-May-10 4:24
Sevententh14-May-10 4:24 
AnswerRe: Extending Entity Data Model Pin
Sevententh17-May-10 1:26
Sevententh17-May-10 1:26 
QuestionMessage Removed Pin
14-May-10 3:47
roman_s14-May-10 3:47 
AnswerRe: Pin
Johnny J.14-May-10 4:01
professionalJohnny J.14-May-10 4:01 
GeneralRe: Pin
roman_s14-May-10 4:11
roman_s14-May-10 4:11 
GeneralRe: Pin
Johnny J.14-May-10 4:18
professionalJohnny J.14-May-10 4:18 
AnswerRe: Pin
dan!sh 14-May-10 4:02
professional dan!sh 14-May-10 4:02 
GeneralRe: Pin
roman_s14-May-10 4:14
roman_s14-May-10 4:14 
GeneralRe: Pin
dan!sh 14-May-10 4:20
professional dan!sh 14-May-10 4:20 
GeneralRe: Pin
roman_s14-May-10 5:07
roman_s14-May-10 5:07 
GeneralRe: Pin
AspDotNetDev14-May-10 11:16
protectorAspDotNetDev14-May-10 11:16 
GeneralOriginal Question Pin
AspDotNetDev14-May-10 18:27
protectorAspDotNetDev14-May-10 18:27 
QuestionDirectShow Pin
TimSWatson14-May-10 0:56
TimSWatson14-May-10 0:56 
AnswerRe: DirectShow Pin
#realJSOP14-May-10 1:45
mve#realJSOP14-May-10 1:45 
Questionhow to play multiple video files in windows media player using C# Pin
NetMan201214-May-10 0:44
NetMan201214-May-10 0:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.