Android How to remove Empty Space
I want to remove empty space. For examp开发者_高级运维le: rama chan dran
should become ramachandran
.
String s = "rama chan dran.....";
s = s.replace(" ", "");
This is more of a Java question than Android specific, but have a look at:
public String replaceAll(String regex, String replacement)
Use replaceAll() method of String class. For Example:
String s = "Test Test Tes t";
System.out.println(s.replaceAll(" ", "");
精彩评论