Replace null character in Java replacement string

In the project, some invisible characters will be received, and NUL will be displayed in the editor, which can't be replaced with an empty string.

0000 0000 0 00 BAD Null

can be replaced with this

 String res = res.replace(Character.toString('\0'), "");

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324910727&siteId=291194637