开发者

What characters will comprise a carriage return in an html textarea?

For example on my PC it looks like it will use "\r\n"? Could it eve开发者_如何学编程r be something different than that?


Historically it's \r\n on Windows, \r on Mac and \n on *nix. If you take these into consideration you 're golden.

Also: I don't know if this is relevant in your case, but typically many programming languages define a string constant which represents the "native" form of end-of-line for the system they are running on (e.g. PHP_EOL in PHP, Environtment.Newline in C#, etc).


It depends upon the OS I guess, the same old story:

  • \n for unix like (and I think OS X too)
  • \r\n for windows like
  • \r old Apple OSes
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜