I want to remove space from the below string.
String name= "I n p u t T e x t";
Can someone please suggest how to remove the spaces?
I have solution only to remove spaces between the string not between the char
I want to remove space from the below string.
String name= "I n p u t T e x t";
Can someone please suggest how to remove the spaces?
I have solution only to remove spaces between the string not between the char
Try following:
String name= "I n p u t T e x t";
String namenew = name.replaceAll("\\s+","");
System.out.println(name);
System.out.println(namenew);
Cheers !