newline

Collapsible 'list' of bound elements in WPF

I have what I thought was a simple requirement, but I'm having difficulty working out how to do it. I'm binding to an address (Line1, Line2, Line3, Line4 for example) What I want to do is display Line1 Line2 Line3 Line4 But if any line is empty or null, I'd like to 'collapse': Line1 Line3 Line4 I've tried a StackPanel with TextBl...

Preserving enters in user's input by PHP

How can you preserve "enters" given by the user in the database and show them then to other users? I store the question of the user and use the following functions to sanitize the user data, prepare it, and execute the SQL command, respectively. pg_escape_string pg_prepare pg_execute I use htmlentities with ENT_QUOTES to convert t...

Is it possible in PHP to escape newlines in strings as in C ?

In C you can continue a string literal in the next line escaping the newline character: char* p = "hello \ new line."; ( My C is a bit rusty and this could be non 100% accurate ) But in php, the backslash is taking literally: $p = "hello \ new line."; I.E. the backslash character forms part of the string. Is there a way to get the C ...

mySQL query fails when read from file or web

This is driving me nuts! I have created a query. The query is written to Windows file for future connection to the remote database. Upon the connection using cURL, my local script uses cURL to send the query. I assemble variables using build_http_query. The cURL works just fine but the query fails. Every time. mySQL complains that qu...

How to accept "enter" value?

I am using php5. I am doing a form, a textarea, where user can send it to his/her friends. But currently, in my textarea form, if i type : Hello XXX, Its been a while. How are you? But when I echo it, it displays Hello XXX, Its been a while. How are you? How do I accept the enter button, so that when I display I can d...

What is the difference between "\r" and "\n"?

Possible Duplicate: What is the difference between \r and \n? I understand that it's different for each Operating System, for example, "\r\n" may be expected in Windows, "\n" may be expected in Unix and "\r" may be expected in Macs. What are the differences between these two (or three, if you want to include "\r\n") escape se...

django newline problem

hi all, i am using django for development. retriving some text with newline from database. but when i render it to template and print in template do not show newline char. what is the porblem ?? plz any one , if can help me BR// Nazmul ...

PHP line breaks being messed up by GIT

Our website has one section which often changes to match the user. (examples are greatly simplified). user:Mike last visit:Yesterday The method used to update the content [which I cannot now change] is that php searches the html webpage for the default content, and replaces it with new content before serving it to the user. $stats = ...

Make a new line in a GridView

Hi, I've an ASP.Net 2.0 Gridview control that I can bind a List<T> too, for a specific field in List<T> like "Old" and "New" I want to place new line characters that will break the text into separate lines e.g.: Column1=Value1 Column2=Value2 to become: Column1=Value1 Column2=Value2 ...

nl2br more than one newline

Hi, I am using nl2br to convert nl chars to tag but for ex i want to convert "Hello \n\n\n\n Everybody" to "Hello Everybody" also i want to convert multinewlines to one br tag. How can i do this ? ...

iPhone-SDK: UITextView doesn't show the newline key

I could get the keyboard to work but on a UITextView but some how the new line key doesn't show up. please help me thanks ...

Text Editor which shows /r/n?

I'm looking for a text editor that can show me the actual carriage returns and newlines. E.g. if I save this string: "This\rIs\r\nA\nString" Instead of showing This Is A String I'm looking for some text editor which will show This\rIs\r\nA\nString I believe a problem with my text-file parsing in a certain program is being caused ...

Why isn't return bound to newline-and-indent by default on emacs

I have tried emacs on and off for a while now and every time I start emacs, I go through the same routine. Customizing. The first one is binding return to newline-and-indent. (g)Vim does this by default. Showing matching parenthesis is also done by default on (g)Vim. It is grea that I can customize emacs to my heart's content but why doe...

No newline after (sub)section?

I want my text to appear right after the call to \subsection{Name} but I can't find how to do it. I'm using the article class. An example of command: \subsection{a)} Blah blah bla... produces: a) Blah blah bla... instead of what I want: a) Blah blah bla... Anything I could do? Thanx a lot! ...

One-liner to convert two newlines to one?

I have a file where I want to convert "\n" to " " and "\n\n" to "\n". For example: I had a toy . It was good . Becomes: I had a toy . It was good . Does anyone have a Unix one-liner for this operation? ...

How to show newlines from textarea in a table?

hi there in a form I have a textarea where obviously text is entered. When the input is finished the content gets submitted to the server and is being stored in a database... When i display the input the user made within a table, the newlines are not visible. When I inspect the source the newlines are there, but within a table the newlin...

Newline Control for JasperReports 3.6.

I'm working with JasperReports 3.6 and trying to create a report with the PDF format which will meet our customer's needs. By exporting to PDF, I found that multi-byte characters (Japanese/Shift-JIS, EUC-JP, UTF-8, ISO-2022-JP) would be printed in the newline automatically without setting the "/n" code. The field would be expected to s...

php syntax for new line is not working

Hello, I am having a rather simple question can anyone tell me why this is not displaying each variable on a new line, well except for the <br>. $curtime = gmdate("d/m/Y H:i:s"); //capture the PayPal returned information as order remarks $oremarks = "##$curtime##<br>". "PayPal Transaction Information...\n". "Txn Id: ".$ppInfo["txn...

C++ change newline from CR+LF to LF

I am writing code that runs in Windows and outputs a text file that later becomes the input to a program in Linux. This program behaves incorrectly when given files that have newlines that are CR+LF rather than just LF. I know that I can use tools like dos2unix, but I'd like to skip the extra step. Is it possible to get a C++ program i...

.NET "default line terminator"?

Is there any way to figure out what .NET is using as it's "default line terminator"? For example, documentation for StringBuilder.AppendLine(String) says it "Appends a copy of the specified string followed by the default line terminator...". Several text-related classes in .NET refer to the same concept. Is there any way to programmat...