zoukankan      html  css  js  c++  java
  • 正斜杠和反斜杠

    正斜杠/,反斜杠

    正斜杠,

      作为运算符,表示除号

      在Mac和Unix上,表示路径分隔符

      在网址URL中,表示路径分隔符

      在日常文字中,表示顿号

    反斜杠,

      在Windows平台上,表示路径分隔符

    What is the difference between a backslash and a forward slash?

    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:

    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 FilesCommon Filesmicrosoft shared). On Mac and Unix systems, forward slashes are used for the same purpose (ex: /System/Library/Screen Savers).

    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.

    Backslash () vs. Forward Slash (/)

    Return to Phill Conrad's:         home page             CS8 page            CS16 page        

    Introduction

    In working with many software tools, programming languages and operating systems, it is crucial to distinguish between backslash and forward slash. Here's a way to remember which one is which.

    Imagine the cursor walking across the screen as a person.

    In English, we write from left to right. So the cursor moves across the screen from left to right as we type, like this:

     
     

    Imagine that cursor as a person, facing in the direction he/she is walking:

     
    person facing right

    Now:

    • if the person leans backward, he/she looks like a backslash
    • if the person leans forward, he/she looks like a forward slash

    backslash forward slash stick figures leaning backwards and forwards.

    Applications

    Backslash is used for:

    • file names in DOS and Windows,
      • e.g. C:Python31python.exeC:cs8cTurtle.py
    • escape sequences in C, Unix, and other languages/systems that borrow the same syntax (C++, Java, etc.)
      • for example n means newline, means tab

    Forward slash is used for:

    • File names in Unix (and Mac OS X, since it is derived from Unix), e.g.
      /cs/student/jsmith/cs8/lab00/Users/Shared/cs8/cTurtle.py
    • Web addresses (URLs) such as http://www.cs.ucsb.edu/~pconrad/cs8
    • Dividing in many progamming languages, e.g. battingAvg = hits / atBats;

  • 相关阅读:
    超链接标签的CSS伪类link,visited,hover,active
    CSS系列(8) CSS后代选择器和子选择器详解
    CSS系列(7)CSS类选择器Class详解
    CSS系列(6) CSS通配符详解
    CSS系列(5)-如何使用Firebug查看网页的html和css
    我给女朋友讲编程CSS系列(4) CSS盒子模型
    两次理发感悟到的人生
    我给女朋友讲编程CSS系列(3) CSS如何设置字体的类型、大小、颜色,如何使用火狐浏览器的Firebug插件查看网页的字体
    SSH不允许进行DNS解析
    项目发布平台
  • 原文地址:https://www.cnblogs.com/yanhc/p/10259770.html
Copyright © 2011-2022 走看看