Google treats hyphens as spaces. Google does not treat underscores as spaces.

Because of this, the string “search_engine” will not show up in a search for “search engine”, but the string “search-engine” will show up in that search.

The end result is that hyphens are much better, from an SEO perspective, than underscores.

This rule seems to hold true for use in text, in file names, and in domain names.