In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how to deal with newline characters in PHP. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
First of all, talk about the difference between\ r and\ n.
The origin and difference of the two concepts of "Carriage Return" and "Line Feed".
Before the advent of computers, there was a device called a teletypewriter (where the concept of tty in Teletype Model 33 Linux Unix also came from) that could type 10 characters per second. But it has a problem, that is, it takes 0.2 seconds to type a newline, which is exactly two characters. If a new character is passed in these 0.2 seconds, then the character will be lost.
So the developers came up with a solution to this problem by adding two characters after each line to indicate the end. One is called "enter", which tells the typewriter to position the printhead at the left boundary; the other is called "line break", which tells the typewriter to move the paper down one line. This is the origin of "line change" and "enter", and one or two can be seen from their English names.
Later, the computer was invented, and these two concepts were applied to the computer. At that time, memory was so expensive that some scientists thought it was too wasteful to add two characters to the end of each line. As a result, differences emerged.
In the Unix system, there is only "" or "\ n" at the end of each line; in the Windows system, the end of each line is "", that is, "\ n\ r"; in the Mac system, the end of each line is "", that is, "\ n". One direct consequence is that if files under Unix/Mac are opened in Windows, all text will become one line, while files in Windows will have an extra ^ M symbol at the end of each line if they are opened under Unix/Mac.
C language programming (windows system)
\ r it means that return goes back to the beginning of the line, which will overwrite the previous output of this line.
Such as: (note the following is the C++ code)
In the end, only xixi is displayed and the back of is covered.
The copy code is as follows:
Int main ()
{
Cout
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.