Skip to content

mkyong.com

  • Spring Boot
  • Java Virtual Threads
  • Contact
  1. Home /
  2. replace

Tag: replace

j
java October 25, 2024 2 min read by mkyong 0 comments

How to Replace Spaces with Dashes in Java

We can use the Java String built-in `replace()` or `replaceAll()` methods to replace spaces with dashes (`-`) easily.

Read more How to Replace Spaces with Dashes in Java

Java and Spring tutorials since 2008. Every example is a complete, runnable file, compiled and run on a real machine before it goes out.

About This Site

  • About
  • Editorial Policy
  • Contact
  • Code License
  • Privacy Policy
  • Terms of Use

© 2026 mkyong.com — Powered by WordPress

RSS