Questions tagged [linefeed]

Linefeed, also known as LF, is a character that controls the switching to the next line.

Linefeed, also known as LF, is a character that controls the switching to the next line.

303 questions
106
votes
5 answers

Why does Windows use CR LF?

I understand the difference between the two so there's no need to go into that, but I'm just wondering what the reasoning is behind why Windows uses both CR and LF to indicate a line break. It seems like the Linux method (just using LF) makes a lot…
Kyle
  • 4,261
  • 11
  • 46
  • 85
101
votes
16 answers

Are shell scripts sensitive to encoding and line endings?

I am making an NW.js app on macOS, and want to run the app in dev mode by double-clicking on an icon. In the first step, I'm trying to make my shell script work. Using VS Code on Windows (I wanted to gain time), I have created a run-nw file at the…
thomasb
  • 5,816
  • 10
  • 57
  • 92
82
votes
14 answers

PHP: Telegram Bot: Insert line break to text message

"\n" and "\r\n", tested in text message sent by telegram bot, to create line break. Instead of showing line break, underline _ will appear after using them. How I could printing line feed in telegram message sent by bot? CODE $txt = 'با تشکر از…
Hossein Shahsahebi
  • 6,348
  • 5
  • 24
  • 38
64
votes
9 answers

In C#, what's the difference between \n and \r\n?

In C#, what's the difference between \n and \r\n?
Aperture
  • 2,387
  • 4
  • 25
  • 47
55
votes
6 answers

Carriage Return\Line feed in Java

I have created a text file in Unix environment using Java code. For writing the text file I am using java.io.FileWriter and BufferedWriter. And for newline after each row I am using bw.newLine() method (where bw is object of BufferedWriter). And I'm…
Manu
  • 3,179
  • 23
  • 57
  • 69
41
votes
1 answer

How to add a newline (line break) in an XML file?

I have an XML file and I would like to make a new line in the text "Sample Text 123" like this Sample Text 123 I've tried already everything I mean \n but nothing works:
Christian
  • 535
  • 1
  • 6
  • 13
37
votes
11 answers

Anything like dos2unix for Windows?

I have some shell scripts created on Windows. I want to run dos2unix on them. I have read that dos2unix works on Linux. Is there a way that I can convert my files to having Unix newlines while working on Windows?
Elvin
  • 2,131
  • 8
  • 23
  • 25
33
votes
5 answers

Carriage return and Line feed... Are both required in C#?

When inserting a new line character into a string I have usually done this: str = "First line\nSecond line"; In C#, is this the standard practice? Should I also include the 'carriage return' character '\r'? Are there any difference between the…
Luke Baulch
  • 3,626
  • 6
  • 36
  • 44
29
votes
4 answers

How to get carriage return without line feed effect in Eclipse console?

If I System.out.print("something\r"); at console, I have cursor back at the beginning of line, and finally after System.out.print("something\r"); System.out.print(" any\r"); I have anything typed. But at Eclipse console I get something …
Dims
  • 47,675
  • 117
  • 331
  • 600
23
votes
3 answers

convert new line /n to a line break in angular

I have a string which contain new line character /n. Trying to display the string. Instead of taking the /n as new line, it displays '/n' as text. $scope.myOutput = " Hello /n" {{ myOutput | textFormat }} Required -> Hello (on html…
Rk R Bairi
  • 1,289
  • 7
  • 15
  • 39
22
votes
5 answers

PowerShell's pipe adds linefeed

I'm trying to pipe a string into a program's STDIN without any trailing linefeeds (unless that string itself actually ends in a linefeed). I tried googling around, but I only found people trying to print to the console without a trailing linefeed,…
Martin Ender
  • 43,427
  • 11
  • 90
  • 130
21
votes
1 answer

Avoid writing carriage return '\r' when writing line feed with Python

If taken into consideration that carriage return = \r and line feed = \n Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:38:48) [MSC v.1900 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>…
Ubica
  • 1,011
  • 2
  • 8
  • 18
15
votes
2 answers

How do I check if a character is a Unicode new-line character (not only ASCII) in Rust?

Every programming language has their own interpretation of \n and \r. Unicode supports multiple characters that can represent a new line. From the Rust reference: A whitespace escape is one of the characters U+006E (n), U+0072 (r), or U+0074…
Noel Widmer
  • 4,444
  • 9
  • 45
  • 69
15
votes
3 answers

Setting Java VM line.separator

Has anybody found a way how to specify the Java line.separator property on VM startup? I was thinking of something like this: java -Dline.separator="\n" But this doesn't interprete the "\n" as linefeed character. Any ideas?
user346034
14
votes
2 answers

How can I use CSS to insert a line break after but not before an element?

For example: HTML: The quick brown fox {BREAK} jumps over the lazy dog. I want this to display: The quick brown fox {BREAK} jumps over the lazy dog. I looked into the display property, but display:inline; doesn't break…
Matt
  • 21,026
  • 18
  • 63
  • 115
1
2
3
20 21