热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

正斜杠和反斜杠区别

Answer:Theterm“backslash”isonofthemostincorrectlyusedtermsincomputing.People

Answer: The term “backslash” is on of the most incorrectly used terms in computing. People often refer to forward slashes as backslashes, especially when referring to URLs. Web addresses (URLs), such as http://pc.net/helpcenter/, contain forward slashes, rather than backslashes. The difference between a backslash and a forward slash is defined below:

翻译:backslash 也就是反斜杠“\”,在url中,一般使用正斜杠“/”,例如http://pc.net/helpcenter/,具体两者的差别在那:

Backslash: \ 反斜杠

Forward Slash: / 正斜杠

A good way to remember the difference between a backslash and a forward slash is that a backslash leans backwards ( \ ), while a forward slash leans forward ( / ).

翻译:记住两者区别的最好的是,后斜杠是“撇”(捺),正斜杠是“撇丿”

In Windows, backslashes are used to separate directories in file paths (ex: C:\Program Files\Common Files\microsoft shared). On Mac and Unix systems, forward slashes are used for the same purpose (ex: /System/Library/Screen Savers).

翻译:在windows系统中,反斜杠尝尝用于表示文件路径;在unix系统和mac中,正斜杠用于url和文件路径表示。

Forward slashes can also be called simply “slashes,” since they are much more commonly used than backslashes. (Slashes are also used as division symbols and in place of the word “or.”) Therefore, the URL http://pc.net/helpcenter/ could be verbalized, “PC dot net slash help center.” If you say “backslash” when sharing a URL, people will know what you mean, but you might come across as a noob. Therefore, it’s best to get in the habit of using the correct term.

翻译:正斜杠、反斜杠也常常称作“斜杠”,必须正确使用它们。


在现在C#或者web层,经常会用到转义字符,我们就使用反斜杠“\”来进行转义区别。

  1.   \’    单引号
  2. \”    双引号
  3.   \    反斜杠
  4.   \0    空
  5.   \a    警告
  6.   \b    退格
  7.   \f    换页
  8.   \n 换行
  9.   \r    回车
  10. \t    水平制表符
  11.   \v 垂直制表符

推荐阅读
author-avatar
小永远佳瞳_186
这个家伙很懒,什么也没留下!
Tags | 热门标签
RankList | 热门文章
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有