开发者

The following code not working in android?

开发者 https://www.devze.com 2023-03-05 08:24 出处:网络
details.r开发者_JAVA百科eplaceAll(\"null\", \" \"); In the above code i am getting the String details from the database and it may get values of the form : null,null,null,null.
details.r开发者_JAVA百科eplaceAll("null", " ");

In the above code i am getting the String details from the database and it may get values of the form : null,null,null,null.

In order to remove all the "null" from the string i am using the above code, but it is not working.

what is going wrong?

thank you in advance.


replaceAll will not change the String itself, but return a new String with the replacements made. You must assign the return value to get your code to work:

details = details.replaceAll("null", " ");
0

精彩评论

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