How do I format a String in an email so Outlook will print the line breaks?

I’ve just been fighting with this today. Let’s call the behavior of removing the extra line breaks “continuation.” A little experimenting finds the following behavior: Every message starts with continuation off. Lines less than 40 characters long do not trigger continuation, but if continuation is on, they will have their line breaks removed. Lines 40 … Read more

What’s the opposite of a nbsp?

You want the unicode character ZERO-WIDTH SPACE (\u200B). You can get it in HTML with ​ or ​. Explicit breaks and non-breaks: LB7 : Do not break before spaces or zero width space. LB8 : Break before any character following a zero-width space, even if one or more spaces intervene. http://unicode.org/reports/tr14/

How can I replace newline or \r\n with ?

There is already the nl2br() function that inserts <br> tags before new line characters: Example (codepad): <?php // Won’t work $desc=”Line one\nline two”; // Should work $desc2 = “Line one\nline two”; echo nl2br($desc); echo ‘<br/>’; echo nl2br($desc2); ?> But if it is still not working make sure the text $desciption is double-quoted. That’s because single … Read more

Split string in JavaScript and detect line break

Using .split(): var str = `your text that spans multiple lines` // Split the string on \n or \r characters var separateLines = str.split(/\r?\n|\r|\n/g); alert(“Total number of separate lines is: ” + separateLines.length); Or using .match() instead: var str = `your text that spans multiple lines` // Split the string on \n or \r characters … Read more

Carriage Return/Line Feed in .Net Resource File (App_GlobalResources)

I used VB.NET Express Edition to test this. In the resource editor (where you can specify the name of the resource and string content) put the string content separated by Shift+Enter. Lets say you want to type in hello world Type “hello” followed by Shift+Enter and “world”. If you look at the Resources.Resx file (which … Read more