Hyphens join two words to make one word, and dashes divide one sentence to make two sentences.
Suzy took her yellow-feathered canary to school -– it flew away.
Some writers use one minus sign for hyphens and dashes, and some use an EN dash (Ctrl-Underline) for hyphens. I use two minus signs (--) or an EM dash ((Ctrl-Alt-Underline) to make it more obvious that there is a dash, not a hyphen between the two sentences.
Most style guides for printed books say that hyphens should join two words without spaces, and that dashes should divide sentences with spaces—unless an EM dash is used between the two parts of a sentence. In that case, there should be no space. Use the examples below to choose how you'd like your hyphens and dashes to appear in your writing.
Suzy took her yellow-feathered canary to school-it flew away.
Suzy took her yellow-feathered canary to school – it flew away.
Suzy took her yellow-feathered canary to school -- it flew away.
Suzy took her yellow-feathered canary to school—it flew away.
The only caveat for e-books is that hyphens and dashes without a space might create an empty space on the right side of the screen if the user selects a font size that makes the words before and after the dash wrap to the next line.
Suzy took her yellow-feathered canary to
school—it flew away.