The following code not working in android?
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", " ");
精彩评论