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 …