开发者

Android How to remove Empty Space

开发者 https://www.devze.com 2023-02-25 12:51 出处:网络
I want to remove empty space. For examp开发者_高级运维le: rama chan dran should become ramachandran.String s = \"rama chan dran.....\";

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

精彩评论

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