java中String与StringBuilder的相互转换

public class jiaodashu
{
public static void main(String[] args)
{
String str = "abcde";
StringBuilder str0 = new StringBuilder;
str0.append(str); //将str转化为StringBuildeer类型
String str1 = str0.toString(); //将str0转化为String类型

	str.remove("a");//删除a
}

}

posted @ 2020-04-22 19:31  田玉斌  阅读(8866)  评论(0编辑  收藏  举报