newline

New lines and browser/OS compatability

I have a form that accepts a list of values, each value being listed on a separate line of textArea. In my Servlet, I am tokenizing the string I recieve from that textArea based on the new line characters "\r\n", like so: String[] partNumberList = originalPartNumberString.split("\r\n"); This appears to work fine. I get an array of val...

Replace a newline in TSQL

I would like to replace (or remove) a newline character in a TSQL-string. Any Ideas? (UPDATE) The obvious REPLACE(@string,CHAR(13),'') just won't do it... ...

Changing the WMD Line Drop to work always

Hey! I want to make WMD line dropping always apply - It does this on Stackoverflow but the default WMD doesn't! It requires two spaces after text to make a line drop work unless it is more than 1 line drop. I've tried understanding WMD but it's all written in obfuscated code and hard to follow Does anyone know about a fix for this? T...

Why doesn't my regular expression collapse groups of newlines?

I have the following regex to try to reduce groups of newlines: s/(\n|\r\n|\n\r)(\n|\r\n|\n\r)(\n|\r\n|\n\r)+/\n\n/gmi; It started out as: s/\n\n(\n)+/\n\n/gmi I am looking to reduce the number of newlines that are continuous to a maximum of two in a row (just trying to do some cleanup on some files that I am importing for an inter...

Is there a standard for line break characters in web forms?

Can I expect line breaks in text boxes to be one of the common line break conventions or does it depend on the user's OS? i.e.: CR or CR+LF or LF ...

How can I use a multiline value for an HTML tag attribute? (i.e. how do I escape newline?)

How do I include a newline in an HTML tag attribute? For example: <a href="somepage.html" onclick="javascript: foo('This is a multiline string. This is the part after the newline.')">some link</a> Edit: Sorry, bad example, what if the tag happened to not be in javascript, say: <sometag someattr="This is a multiline string. This is...

New Line in C# Notification (Compact Framework)

Hi, I'm trying to use a Notification control in a smart device C# project, but I can't seem to get a new line - I have tried using \n, \r\n and System.Environment.NewLine and none of these work - everything is still showing up on a single line in the standard Visual Studio 2008 emulator. How do I get a new line to show up? ...

How do I switch between Windows and UNIX newlines in Netbeans?

The version of NetBeans that I use is 6.5.1 ...

How can I write a newline in a string in ColdFusion?

Currently I'm putting newlines in strings through one of these two methods: <cfset someStr="This is line 1" & Chr(10) & "This is line 2" & Chr(10) & "This is line 3" /> OR <cfset NL=Chr(10) /> <cfset someStr="This is line 1#NL#This is line 2#NL#This is line 3" /> Is there anything more like the Java/C++ way? Something more like th...

how to write unified new line in PHP?

Obviously it's not "\r\n",which only fits windows,and will cause ^M on linux ...

Which text editors handle both Windows- and Unix-style line breaks properly?

Which text editors (free or commercial) handle character encoding and Windows/Unix line breaks properly? ...

JAVA - Inserting a new line at the next space after 30 characters

I have a large block of text (200+ characters in a String) and need to insert new lines at the next space after 30 characters, to preserve words. Here is what I have now (NOT working): String rawInfo = front.getItemInfo(name); String info = ""; int begin = 0; for(int l=30;(l+30)<rawInfo.length();l+=30) { while(rawInfo.charAt(l)!=' '...

How do I handle embedded newlines in CSV files in Perl?

I'm reading a .csv file that was created in Excel with the first line being column headings. One column heading contains an embedded newline. I want to ignore that newline but reading it line-by-line like: while ( <IN> ) { ... } will treat it as a new line which will break my code (which I haven't written yet). My approach wa...

Setting encoding, newline, linebreaks, end-of-line (EOL) in PHP

For example, when I create a new file: $message = "Hello!"; $fh = fopen(index.html, 'w'); fwrite($fh, $message); fclose($fh); How can I set it's encoding(utf-8 or shift-jis or euc-jp) and linebreaks(LF or CR+LF or CR) in PHP? ...

VIM Disable Automatic Newline At End Of File

So I work in a PHP shop, and we all use different editors, and we all have to work on windows. I use vim, and everyone in the shop keeps complaining that whenever I edit a file there is a newline at the bottom. I've searched around and found that this is a documented behavior of vi & vim... but I was wondering if there was some way to d...

PHP form removing line breaks

Hi, I use a php form processor script that works fine. Except when users submit text in a multi-line text field, any line breaks or new lines are stripped out of the resulting string variable that is passed on. This often makes it unreadable by whoever receives the form results. I'm no php expert but am sure the answer lies in the code...

Perl - Printing the next line

Hi, I am a noob Perl user trying to get my work done ASAP so I can go home on time today :) Basically I need to print the next line of blank lines in a text file. The following is what I have so far. It can locate blank lines perfectly fine. Now I just have to print the next line. open (FOUT, '>>result.txt'); die "File is not a...

How to count lines? : Objective-C

I want to count the lines in an NSString in Objective-C. NSInteger lineNum = 0; NSString *string = @"abcde\nfghijk\nlmnopq\nrstu"; NSInteger length = [string length]; NSRange range = NSMakeRange(0, length); while (range.location < length) { range = [string lineRangeForRange:NSMakeRange(range.location, 0)]; range.lo...

AS3 Input Textfield get text formated with \n for every new line

I have a textfield where the user can type what ever he want into it. When the user is ready typing he can hit the send button. when he does that i get the text from the multiline textfield and pass it to my backend. there is only 1 problem the text is formated in 1 single line, (html text is no option!) is it possible to set after ever...

New lines in Jasper Reports?

I've just started using Jasper Reports to generate reports from data retrieved using Hibernate. Everything is working, except JR doesn't seem to respect newline characters (\n) in text fields. Is there a way to force line breaks at newline characters? ...