Editors know them more than writers, but the humble dash takes various forms and tasks. A lot of writers will plug on with the lowly hyphen (-) which is the shortest of all the dashes. Its job really is not to separate parts of a sentence nor as a substitute for ‘to’ such as in 1945 to 2001. The hyphen is used to join two words to create a single entity, which can lead eventually to dispensing with the hyphen altogether. Take the word ‘cooperate’ for example. Some publications continue to use the hyphen as in ‘co-operate’ to avoid mispronunciation while the accepted form now has no hyphen. That is because it is in common usage and people know how it is pronounced. Two words may be hyphenated to become a single adjective as in ‘short-term solution’. And the danger here is to hyphenate when there is no implied adjective.
The second job of a hyphen is to split a long word in column formatting so as to create an even margin on the right side of the column, or as close to even as possible. Hyphenation then occurs between syllables to avoid an awkward cut of the word.
After hyphens there are two longer forms of dashes with names taken from early typography – the en dash and the em dash. I just used an en dash (roughly the width of the letter ‘n’) to separate the last phrase from the main sentence. Here it can be used instead of the colon to denote something following. When it is used with a space to either side of it, the en dash acts as a separator. This is crucial and a cause for many errors among writers. When you remove the spaces, the en dash joins two parts, not like the hyphen, but roughly to mean ‘to’, as in 1945–2001.
The last dash form – the em dash – is similar to the en dash in that it can be used as a separator, but without spaces. Its use is a matter of publication style or an editor/writer’s preference. The em dash—used like this—separates the verb phrase here instead of using commas, and therefore highlighting the phrase more and avoiding confused phraseology.