Replace dash characters in Java strings
•
Java
See English answers > java string replace not working 6
str.replace("\u2014","");
Can you help me?
Solution
String is immutable in Java You must reassign it to get results:
String str ="your string with dashesh"; str= str.replace("\u2014","");
For more information, see API
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码