How is a colon used?
Below are some different examples of where a colon is used today.
- In a URL, a colon separates the protocol with the address. For example, with http://www.computerhope.com http is the protocol and www.computerhope.com is the address.
- In MS-DOS and the Windows command line, a colon indicates a drive letter. For example, typing in "A:" at the MS-DOS prompt would switch to the A drive or floppy disk drive.
- In a spreadsheet formula, a colon specifies a range. For example, =sum(A1:A20) would add cells A1 through A20.
- A colon in front or end of a word (depending on programming language) creates a label that can be used with a goto.
- In a batch file adding two comments in front of a line creates a remarked line.