开发者

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(" ", "");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜