Whether to use dashes or underscores in a URL depends on which part of the URL you are changing as well as your purpose. It's not always a simple answer.
New Poll: Hyphens, Underscores, or camelCase?
REST API 最佳实践-腾讯云开发者社区-腾讯云
Em Dashes, 2-Em Dashes, and 3-Em Dashes
Hyphens or Underscore in File Names for SEO
htaccess - Remove hyphen from Wordpress URL & replace with underscore - Stack Overflow
REST API 最佳实践-CSDN博客
Underscores vs. dashes in URLs
Email ID with dash at the end of local part - Super User
Using Dashes & Underscores in URLs: SEO-friendly Approach & Results