public class Demo{
public static void main(String[] args) {
String str="1";
System.out.println("str:"+str);//输出:str:1
StringBuilder stringBuilder=new StringBuilder(str);//String转StringBuilder
stringBuilder.append("23");
String appendStr=stringBuilder.toString();//StringBuilder转String
System.out.println("appendStr:"+appendStr);//输出:appendStr:123
}
}
版权声明:本文为wangwenjie1997原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。