Eclipse and line breaks in Windows

Source: Internet
Author: User

Line-break identification for different systems
< Span style= "Background-color:inherit" >windows                   

linux/unix          
   \ n
mac   OS              

Method in Commons-io Package: fileutils.writestringtofile (File, "The first row is \\n\n the second row is \\r\r the third row is \\n\\r\n\r line fourth is \\r\\n\r\n fifth row"); Write this section to a file in Windows Notepad and the Eclipse project directory, respectivelyThis is my test data: The first line is \\n\n the second row is \\r\r the third row is \\n\\r\n\r line fourth is \\r\\n\r\n fifth rowFile write results in eclipse:
The first line is \ n the second line is \ r The third line is \n\r line fourth is \ r \ n Fifth line
Windows Notepad writes the results:
The first line is \ n the second line is \ r The third line is \n\r line fourth is \ r \ n Fifth line
Then you can see that in\ r \ nis a line-wrapping operation under Windows, and \n,\r in Eclipse,\ r \ nCan implement line breaks, and \n\r can implement two lines in eclipse. To ensure that line breaks are possible in both Eclipse and windows, it is recommended to use\ r \ n (because I use Windows)。
Thus, it can be seen that eclipse is actually the support for line-of-exchange identities in different systems, so any one of the identities in eclipse can be wrapped, but specifically selected in a specific system.

Eclipse and line breaks in Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.