1. 使用方法为 replace()
1.1 如下代码:
package testdemo; public class TestReplace { public static void main(String[] args) { String a = "aabbcc"; String b = a.replace("a", "d"); System.out.println(a); System.out.println(b); } }
1.2 结果如下:
原文地址:https://www.cnblogs.com/gxlaqj/p/9933349.html
时间: 2024-10-13 15:22:04