You are probably familiar with two types of dashes: the en rule and the em rule. Neither is to be used as if it is a hyphen.
The en rule (–) is longer than a hyphen (-) and half the length of an em rule (—).
You will often see it used with a space either side as a parenthetical dash; this is usually the preferred style for British publishers (the alternative is a closed-up em rule).
When considering the other uses, it might be helpful to think of the en rule as meaning (roughly) and or to.
The en rule should be used closed up (with no spaces either side) in elements (usually figures) that form a range:
pp. 18–25 1865–72 Monday–Friday
The en rule should also be used at the end of unfinished number ranges.
It is important to remember to always write from xxxx to xxxx or xxxx–xxxx. Do not use a combination of the two. The same applies when writing between xxxx and xxxx.
An en rule can be used closed up to express connection or relation between words, to express an alternative (in a similar way to a solidus) or to indicate joint creators (a hyphen between the names would suggest it was only one person).
En rules can also be used to indicate individual missing letters:
'The utter b – – – – – – !' she shouted.
It isn’t common to see this any more; people tend to be able to cope with seeing rude words spelt out.