I want to format my html through C#. Here my example code.  &lt;div dir="ltr"&gt;&lt;div class="gmail_quote"&gt;&lt;strong&gt;&lt;span style="font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;CA IQVIA EM Event Speaker info&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;/div&gt;  I want to output like this :  `&lt;div dir="ltr"&gt;     &lt;div class="gmail_quote"&gt;        &lt;strong&gt;         &lt;span style="font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;            CA IQVIA EM Event Speaker info          &lt;/span&gt;         &lt;/strong&gt;     &lt;/div&gt;  &lt;/div&gt;`   How Should I achieve this? Thanks in advance.
120955
I am creating a lightweight editor in C# and would like to know the best method for converting a string into a nicely formatted XML string.  I would hope that there's a public method in the C# library like "public bool FormatAsXml(string text, out string formattedXmlText)", but it couldn't be that easy, could it?  Very specifically, what would the method "SomeMethod" have to be that would produce the output below?  string unformattedXml; string formattedXml;  unformattedXml = "&lt;?xml version=\"1.0\"?&gt;&lt;book&gt;&lt;author&gt;Lewis, C.S.&lt;/author&gt;&lt;title&gt;The Four Loves&lt;/title&gt;&lt;/book&gt;" formattedXml = SomeMethod(unformattedXml);  Console.WriteLine(formattedXml);   Output:  &lt;?xml version="1.0"?&gt;   &lt;book id="123"&gt;     &lt;author&gt;Lewis, C.S.&lt;/author&gt;     &lt;title&gt;The Four Loves&lt;/title&gt;   &lt;/book&gt;
63655
When I hit /// in Visual Studio, is it possible to change the resulting snippet from this:  /// &lt;summary&gt; ///  /// &lt;/summary&gt;   to this?:  /// &lt;summary&gt;&lt;/summary&gt;
24624
I have snippets of Html stored in a table. Not entire pages, no  tags or the like, just basic formatting.  I would like to be able to display that Html as text only, no formatting, on a given page (actually just the first 30 - 50 characters but that's the easy bit).  How do I place the "text" within that Html into a string as straight text?  So this piece of code.  &lt;b&gt;Hello World.&lt;/b&gt;&lt;br/&gt;&lt;p&gt;&lt;i&gt;Is there anyone out there?&lt;/i&gt;&lt;p&gt;   Becomes:  Hello World. Is there anyone out there?
17958
I'd like to use JavaScript to calculate the width of a string. Is this possible without having to use a monospace typeface?  If it's not built-in, my only idea is to create a table of widths for each character, but this is pretty unreasonable especially supporting  and different type sizes (and all browsers for that matter).
121940
I know this maybe a basic question but I just can't seem to find the answer anywhere.  I have a class like this  Table&lt;T&gt; {}   then I have some code that uses the above class that I would like to comment I would like to be able to do something like:  /// &lt;summary&gt; /// blah blah blah Table&lt;String&gt; /// &lt;/summary&gt;   But I can't use the angle bracket in the comment as it thinks it's a tag and when the help shows up it just has an error about no end tag for .  How do I show generic classes in comments in Visual Studio.
91211
I am currently writing my thesis and need to include a bunch of email conversions. I am using classicthesis. I wonder, how you would format stacked conversions. Moreover, how would you deal with the email header, signatures and line breaks: why do I need to add \\ all the time? This is the configuration I am currently experimenting with:  \documentclass[ oneside, openright, titlepage, dottedtoc, numbers=noenddot, headinclude, footinclude=true, cleardoublepage=empty, abstractoff, BCOR=5mm, paper=a4, fontsize=11pt, ngerman, american ] {scrreprt}  \PassOptionsToPackage{utf8}{inputenc} \usepackage{inputenc} \usepackage{blindtext}  \usepackage{framed}  % Vertical line that highlights quotations in an email. % Use \begin{leftbar} and \end{leftbar} environment. % Width of the line = 0.4pt % Space between the line and the text = 10pt % Requires \usepackage{framed} \renewenvironment{leftbar}{%   \def\FrameCommand{\vrule width 0.4pt \hspace{10pt}}%   \MakeFramed {\advance\hsize-\width \FrameRestore}}% {\endMakeFramed}  \usepackage{nicefrac} \usepackage[english]{babel} \usepackage[pdfspacing]{classicthesis}  \begin{document} \selectlanguage{ngerman} % american ngerman % Disable paragraph indentation. \setlength{\parindent}{0pt}     \begin{verbatim} From: john.doe@yahoo.com Subject: Your inquiry from 20042012 Date: Thu, 3 May 2012 11:34:54 +0200 To: Jane Doe &lt;jane.doe@hotmail.com&gt; \end{verbatim}  Jane Doe wrote: \begin{leftbar} \begin{leftbar} \begin{leftbar} \begin{leftbar} There are a couple of questions I like to ask. Please forward them if you cannot do so. \end{leftbar} I hope I can answer them after holidays. \end{leftbar} I am back from holidays now and will look through your questionaire the next days. \end{leftbar} Thank you, Mr. Doe - I am awaiting your answers. \end{leftbar}  Dear Mrs. Doe,\\ \ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut molestie placerat pharetra. In quam leo, tincidunt ut consequat eget, malesuada sit amet urna. Morbi et interdum arcu. Nullam nisi nunc, ullamcorper vitae pulvinar eu, suscipit ut augue.\\ \ Donec risus mi, accumsan ac interdum id, molestie sed mauris. Suspendisse porttitor luctus justo in ullamcorper. Proin in neque magna. Mauris quis arcu eget enim mattis pharetra vitae a dolor. Nam aliquam consectetur mollis. Ut at sem quis dolor faucibus fringilla. Quisque cursus vehicula odio, vitae placerat ipsum dapibus id.\\ \ Best regards\\ John Doe\\ \ (See attached file: Questions\_Doe.doc)  \begin{verbatim} _______________________________________________________ Administration New York John Doe Mainstr. 3 11111 New York  T:        (011) 212-4301 F:            (011) 212-954301 M:         john.doe@yahoo.com \end{verbatim}  \begin{leftbar} My question I looking forward to reading the answers to my questions:\\ \ 1. Is the world analog or digital? \end{leftbar} digital  \begin{leftbar} 2. How long does the world exist?  \end{leftbar} analog since 1984, digital since 1999  \end{document}     This is what the above latex example looks like.    I also saw  but I do not want to use &gt; or colors. My settings are inspired by this  and this .
53171
Formatting numbers on a VF page, but I do a bunch of processing the Apex Class, so I would rather return the formatted String value from the controller.   I am doing something like this, but I just want the second number to appear as "(1500)" rather "-1500"  Getting lost in the Message Format docs, so hoping someone can guide me in the right direction...  List&lt;String&gt; args = new String[]{'0','number','###,###,###'}; system.debug('Positive' + String.format(  ( (1000) - (500.50)  ).round().format(), args) ); system.debug('Negative' + String.format(  ( (-1000) - (500.50)  ).round().format(), args) );
76848
I switched from Windows 7 to Ubuntu 14.04. The following code was producing this .  \documentclass[oneside,english,a4paper, 12pt]{book} \usepackage{a4wide, fullpage, color, fancyhdr, lastpage, changepage, multirow, calligra, graphicx}     \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{geometry} \geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}  \makeatletter \let\ps@plain\ps@fancy% Plain page style = fancy page style \makeatother  \providecommand*{\wb}[2]{\fontsize{#1}{#2}\usefont{U}{webo}{xl}{n}} \newcommand*{\cdiam}{\prec\kern-2pt\succ} \IfFileExists{upquote.sty}{\usepackage{upquote}}{}  \begin{document} \begin{titlepage} \fontfamily{pbk}\selectfont   \begin{adjustwidth*}{1.5cm}{2cm}     \vspace*{4.5\baselineskip}     \centering     \begin{picture}(600, 0)       \multiput(0, 110)(20, 0){20}{{\wb{10}{12}4}}                    % Top Line       \multiput(-5, 90)(0,-21){35}{\rotatebox{90}{{\wb{10}{12}4}}}    % Left Line       \multiput(0,-630)(20, 0){20}{{\wb{10}{12}4}}                    % Bottom Line       \multiput(400,90)(0,-21){35}{\rotatebox{90}{{\wb{10}{12}4}}}    % Right Line     \end{picture}     \end{adjustwidth*}     \end{titlepage} \end{document}   But now on Ubuntu 14.04 I'm getting output with the border shows up as a string of the number 4. I would highly appreciate if someone guide me how to install the required fonts. Thanks
50386
I have a code, that outputs a standard pager:  print theme('pager');   it outputs this:  &lt;h2 class="element-invisible"&gt;Pages&lt;/h2&gt; &lt;div class="item-list"&gt; &lt;ul class="pager"&gt;&lt;li class="pager-current first"&gt;1&lt;/li&gt; &lt;li class="pager-item"&gt;&lt;a title="Go to page 2" href="/drupal/node?page=1"&gt;2&lt;/a&gt;&lt;/li&gt; &lt;li class="pager-item"&gt;&lt;a title="Go to page 3" href="/drupal/node?page=2"&gt;3&lt;/a&gt;&lt;/li&gt; &lt;li class="pager-next"&gt;&lt;a title="Go to next page" href="/drupal/node?page=1"&gt;next ›&lt;/a&gt;&lt;/li&gt; &lt;li class="pager-last last"&gt;&lt;a title="Go to last page" href="/drupal/node?page=5"&gt;last »&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;   How can I change the HTML to something like this:  &lt;ul class="pagination"&gt;     &lt;li&gt;&lt;a href="#"&gt;&amp;lt;&lt;/a&gt;&lt;/li&gt;     &lt;li&gt;&lt;a href="#"&gt;1&lt;/a&gt;&lt;/li&gt;     &lt;li&gt;&lt;a href="#" class="active"&gt;2&lt;/a&gt;&lt;/li&gt;     &lt;li&gt;&lt;a href="#"&gt;3&lt;/a&gt;&lt;/li&gt;     &lt;li&gt;&lt;a href="#"&gt;&amp;gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;   I looked into this thread: , created a function bartik_preprocess_custom_pager and a file custom-pager.tpl.php inside my Bartic theme templates, but I can't make it work.  print theme('custom_pager');   outputs nothing. Does anybody know, how can I customize the HTML output for a pager, creating one just for 1 page?
116773
The .NET Framework gives us the  method:  string s = string.Format("This {0} very {1}.", "is", "funny"); // s is now: "This is very funny."   I would like an "Unformat" function, something like:  object[] params = string.Unformat("This {0} very {1}.", "This is very funny."); // params is now: ["is", "funny"]   I know something similar exists in the ANSI-C library ( vs ).   The question: is there something similiar in C#?  Update: Capturing groups with regular expressions are not the solution I need. They are also one way. I'm looking for a system that can work both ways in a single format. It's OK to give up some functionality (like types and formatting info).
16891
Problem  I want to explain C# programming language step by step using overlay in beamer.cls. But it does NOT works as shown in the following figure.  How to solve this problem?    Code Snippet  \documentclass[dvipsnames,cmyk]{beamer}  \usepackage{listings}  \begin{document}  \defverbatim[colored]\Lst{% \begin{lstlisting}[language={[Sharp]C}] using System; public delegate void Foo(object o); \uncover&lt;1&gt;{public class Foo} \uncover&lt;2&gt;{\{} \uncover&lt;3&gt;{public static void Main()} \end{lstlisting}}  \begin{frame}{MyListing} \Lst \end{frame}  \end{document}
94610
A lot of the time, when I want to format text within a web page's text box I'll hit the Tab key.   Unfortunately, that doesn't insert the tab character but instead moves the control to the next form element (like a button or a check box).   For browsers like Firefox/IE, is there a way to get the formatting behavior of a tab, within a text box, by typing a key combination?
94801
I have the following C# which simply replaces parts of the input string that look like EQUIP:19d005 into URLs, like this:  input = Regex.Replace(input, @"(EQUIP:)(\S+)", @"&lt;a title=""View equipment item $2"" href=""/EquipmentDisplay.asp?eqnum=$2""&gt;$1$2&lt;/a&gt;", RegexOptions.IgnoreCase);   The HTML ends up looking like this.  &lt;a title="View equipment item 19d005" href="/EquipmentDisplay.asp?eqnum=19d005"&gt;EQUIP:19d005&lt;/a&gt;   The only trouble is that the destination page expects the eqnum querystring to be all UPPERCASE so it returns the correct equipment when eqnum=19D005 but fails if it receives eqnum=19d005.  I guess I can modify and correct EquipmentDisplay.asp's errant requirement of uppercase values however, if possible I'd like to make the C# code comply with the existing classic ASP page by uppercasing the $2 in the Regex.Replace statement above.  Ideally, I'd like the HTML returned to look like this:  &lt;a title="View equipment item 19d005" href="/EquipmentDisplay.asp?eqnum=19D005"&gt;EQUIP:19d005&lt;/a&gt;   Notice although the original string was EQUIP:19d005 (lowercase), only the eqnum= value is uppercased.  Can it be done and if so, what's the tidiest way to do it?
13314
I'm looking for a way to insert a &lt;style&gt; tag into an HTML page with JavaScript.  The best way I found so far:  var divNode = document.createElement("div"); divNode.innerHTML = "&lt;br&gt;&lt;style&gt;h1 { background: red; }&lt;/style&gt;"; document.body.appendChild(divNode);   This works in Firefox, Opera and Internet Explorer but not in Google Chrome. Also it's a bit ugly with the &lt;br&gt; in front for IE.  Does anyone know of a way to create a &lt;style&gt; tag that   Is nicer Works with Chrome?   Or maybe   This is a non-standard thing I should avoid Three working browsers are great and who uses Chrome anyway?
46323
A Java version of this question was just answered, and, well, I don't know how to do this in .net.   So how do you calculate the display width of a string in C# / .net?
16027
I need to send email via my C# app. I come from a VB 6 background and had a lot of bad experiences with the MAPI control. First of all, MAPI did not support HTML emails and second, all the emails were sent to my default mail outbox. So I still needed to click on send receive. If I needed to send bulk html bodied emails (100 - 200), what would be the best way to do this in C#?
23120
How can i add a line break to the text area in a html page? i use VB.net for server side coding.