Skip to content

mkyong.com

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

Tag: whitespace

j
java July 23, 2008 1 min read by mkyong 8 comments

Java – How to remove spaces in between the String

This article shows how to use regex to remove spaces in between a String. A string with spaces in between. String text = "Hello World Java."; We want to remove the spaces and display it as below: Hello World Java. 1. Java regex remove spaces In Java, we can use regex \\s+ to match whitespace […]

Read more Java – How to remove spaces in between the String

Recent Posts

  • Java Compact Source File: No Class, No Static Main
  • Java Scoped Values Example
  • Spring Boot RAG Example with Spring AI
  • Java AtomicInteger Example
  • Java Virtual Threads Example
  • Spring Boot Supabase CRUD Example
  • Spring Boot REST Docs Example
  • How to Install Java on Windows (Step-by-Step Guide)

© 2008–2026 mkyong.com

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