想把["-1","-2","01"]字符串使用String的replace()替换,替换后为["01"],但是我使用如下代码处理始终不起作用。求大神帮忙
我的代码如下:
String s = "[\"-1\",\"-2\",\"01\"]";
String t = "\"-1\",\"-2\",";
s.replace(t, "");
System.out.println(s);
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
替换了未赋值!
String s = "["-1","-2","01"]";