这些字符有什么区别? [英] What's the difference between this characters?

查看:87
本文介绍了这些字符有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

\r和\\\
之间的区别是什么


我真的很想知道 \\\
\r \ t chr(13),它们如何在Web应用程序中使用, ,等等。



例如,您可以确认Windows使用 \\\
\r
作为newline,而linux只使用 \\\
对吗?



谢谢

解决方案

\ n - 换行 - 0x0A - 十进制 - LF



<\\ r> \ r - 回车 - 0X0D - 十进制13 - CR



\ t - 选项卡 - 0x09 - 9位十进制 - ht(水平制表符)

详细十六进制,十进制值表示:
< a href =http://web.cs.mun.ca/~michael/c/ascii-table.html =noreferrer> http://web.cs.mun.ca/~michael/c/ ascii-table.html



CR + LF:DEC TOPS-10,RT-11和大多数其他早期的非Unix和非IBM OS,CP / M,MP / M,DOS(MS-DOS,PC-DOS等),Atari TOS,OS / 2,Microsoft Windows,Symbian操作系统,Palm OS

LF + CR:Acorn BBC假脱机文字输出。

CR:Commodore 8位机器,Acorn BBC,TRS-80,Apple II系列,Mac OS版本9和OS-9 LF:Multics,Unix和类Unix系统(GNU / Linux,AIX,Xenix,Mac OS X,FreeBSD等),BeOS ,Amiga,RISC OS,an d其他人。但是,在tty'原始模式'中,CR + LF用于输出,CR用于输入。



RS:QNX pre-POSIX实现。



有关\\\
,\r \t的更多详细信息,请参阅:

http://en.wikipedia.org/wiki/Newline



< a href =http://zh.wikipedia.org/wiki/Carriage_return =noreferrer> http://en.wikipedia.org/wiki/Carriage_return



http://en.wikipedia.org/wiki/Horizo​​ntal_tab p>

要在html中使用\ n \r \t,您可以使用以下代码:

  \\\
在html ==&#10;或&#x0A; linux,Unix和Mac OS X

\ r html ==&#13;或&#x0D; Mac(经典)

\ r \ n在html ==&#13;&#10;或&#x0D;&#x0A; Windows

\ t在html ==&#9;或&#x09;


Possible Duplicate:
What is the difference between \r and \n?

I really would like to know what's the difference between \n , \r , \t , chr(13) , how they are used in a web application, in which OS, and so on.

For example, can you confirm that windows uses \n\r for the newline, while of linux uses just \n right? It would be interesting to know these things.

Thanks

解决方案

\n - Line Feed - 0x0A - 10 decimal - LF

\r - Carriage Return - 0X0D - 13 decimal - CR

\t - tab - 0x09 - 9 decimal - ht (horizontal tab)

For detailed hex, decimal values refer: http://web.cs.mun.ca/~michael/c/ascii-table.html

CR+LF: DEC TOPS-10, RT-11 and most other early non-Unix and non-IBM OSes, CP/M, MP/M, DOS (MS-DOS, PC-DOS, etc.), Atari TOS, OS/2, Microsoft Windows, Symbian OS, Palm OS

LF+CR: Acorn BBC spooled text output.

CR: Commodore 8-bit machines, Acorn BBC, TRS-80, Apple II family, Mac OS up to version 9 and OS-9

LF: Multics, Unix and Unix-like systems (GNU/Linux, AIX, Xenix, Mac OS X, FreeBSD, etc.), BeOS, Amiga, RISC OS, and others. However, in tty 'raw mode', CR+LF is used for output and CR is used for input.

RS: QNX pre-POSIX implementation.

For more details on \n, \r \t refer:

http://en.wikipedia.org/wiki/Newline

http://en.wikipedia.org/wiki/Carriage_return

http://en.wikipedia.org/wiki/Horizontal_tab

To use \n \r \t in html for you can use the below codes:

\n in html == &#10; or &#x0A; linux, Unix and Mac OS X

\r in html == &#13; or &#x0D; Mac(classic)

\r\n in html == &#13;&#10; or &#x0D;&#x0A; Windows

\t in html == &#9; or &#x09; 

这篇关于这些字符有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆