replace any single character with space in java

replace any single character with space in java
/**
 * @author lautturi.com 
 * Java example: java replace all single characters in string
 */

import java.util.*;

public class Lautturi {
	public static void main(String[] args) {
		String str = "welcom to java world. Java is a high-level programming language.";

		System.out.println(str);
		str = str.replaceAll("(?<!\\S)[^ ](?!\\S)", " ").trim();
		System.out.println(str);
	}
}
So‮cru‬e:www.lautturi.com

output:

welcom to java world. Java is a high-level programming language.
welcom to java world. Java is   high-level programming language.
Created Time:2017-09-28 21:50:13  Author:lautturi