105-StringBuilder的更多方法

3,Insert()追加特定格式的字符串

sb.Insert(0, "http://");
Console.WriteLine(sb);

4,Remove()从当前字符串中删除字符

sb.Remove(0, 3);
Console.WriteLine(sb);

5,Replace()在当前字符串中,用某个字符或者字符串全部替换另一个字符或者字符串

sb.Replace(".", "");
sb.Replace('.', '-');
Console.WriteLine(sb);

6,ToString()把当前stringBuilder中存储的字符串,提取成一个不可变的字符串

posted @ 2018-11-14 16:50  阿晖2222  阅读(193)  评论(0编辑  收藏  举报