Remove extra spaces from a string | * Java Program to remove extra spaces from a string *
public class GFG { public static void main ( String args [ ] ) { String str = " ▁ Hello ▁ Geeks ▁ . ▁ Welcome ▁ , TABSYMBOL Do ▁ you ▁ love ▁ Geeks ▁ , ▁ Geeks ▁ ? ▁ " ; System . out . println ( str . replaceAll ( " \\ s + " , " ▁ " ) . trim ( ) ) ; } }