Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Slash (punctuation)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
====Programming==== The slash is used as a [[#Division|division operator]] in most [[programming language]]s while [[APL (programming language)|APL]] uses it for reduction ([[Fold (higher-order function)|fold]]) and compression ([[Filter (higher-order function)|filter]]). The double slash is used by [[Rexx]] as a [[#Mod|modulo operator]], and [[Python (programming language)|Python]] (starting in version 2.2) uses a double slash for division which rounds (using [[Floor and ceiling functions|floor]]) to an integer. In [[Raku (programming language)|Raku]] the double slash is used as a "defined-or" alternative to '''||'''. A dot and slash {{angle brackets|./}} is used in [[MATLAB]] and [[GNU Octave]] to indicate an element-by-element division of matrices. [[comment (computer programming)|Comments]] that begin with {{mono|'''/*'''}} (a slash and an asterisk) and end with {{mono|'''*/'''}} were introduced in [[PL/I]] and subsequently adopted by [[SAS System|SAS]], [[C (programming language)|C]], Rexx, [[C++]], [[Java (programming language)|Java]], [[JavaScript]], [[PHP]], [[Cascading Style Sheets|CSS]], and [[C Sharp (programming language)|C#]]. A double slash {{mono|'''//'''}} is also used by [[C99]], C++, C#, PHP, Java, [[Swift (programming language)|Swift]], [[Pascal (programming_language)|Pascal]] and JavaScript to start a single line comment. In [[SGML]] and derived languages such as [[HTML]] and [[XML]], a slash is used in closing tags. For example, in HTML, {{mono|<b>}} begins a section of {{strong|bold}} text and {{mono|</b>}} closes it. In XHTML, slashes are also necessary for "self-closing" elements such as the [[newline]] command {{nowrap|{{mono|<br />}}}} where HTML has simply {{nowrap|{{mono|<br>}}}}. In a style originating in the [[Digital Equipment Corporation]] line of operating systems ([[OS/8]], [[RT-11]], [[TOPS-10]], et cetera), [[Windows (operating system)|Windows]], [[DOS]], some [[CP/M]] programs, [[OpenVMS]], and [[OS/2]] all use the slash to indicate [[command-line option]]s. For example, the command {{mono|dir/w}} is understood as using the command [[dir (command)|dir]] ("directory") with the "wide" option. No space is required between the command and the switch; this was the reason for the choice to use backslashes as the path separator since one would otherwise be unable to run a program in a different directory. Slashes are used as the standard delimiters for [[regular expression]]s, although other characters can be used instead. [[IBM JCL]] uses a double slash to start each line in a batch job stream except for /* and /&.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)