C# StringBuider,字符串拼接工具类
来源:互联网 发布:general yoast seo 编辑:程序博客网 时间:2024/05/23 19:16
StringBuilder 它就是拼接字符串的一个工具,拼成完成后,还是需要将它转回字符串。
using System;using System.Collections.Generic;using System.Diagnostics;using System.Linq;using System.Text;namespace _02StringBuilder{ class Program { static void Main(string[] args) { //string str = string.Empty; //StringBuilder sb = new StringBuilder(); ////00:00:00.1022297 //Stopwatch sp = new Stopwatch(); //sp.Start(); //for (int i = 0; i < 100000; i++) //{ // //str += i; // sb.Append(i); //} //sp.Stop(); //Console.WriteLine(sp.Elapsed); //Console.WriteLine(sb.ToString()); StringBuilder sb = new StringBuilder(); sb.Append("张三"); sb.Append("李四"); sb.Append("王狗蛋儿"); sb.Insert(1, "新来哒"); sb.Replace("王狗蛋儿", "***"); Console.WriteLine(sb.ToString()); Console.ReadKey(); } }}
阅读全文
0 0
- C# StringBuider,字符串拼接工具类
- 字符串拼接工具类
- string拼接字符串stringbuider和stringbuffer的区别
- C# StringBuider
- SQL字符串拼接工具
- c#拼接字符串
- c#拼接字符串
- c# 字符串拼接效率
- C#字符串拼接方法
- c#字符串拼接
- C# String StringBuider 解惑
- C#性能之字符串拼接
- C#使用Aggregate拼接字符串
- C#中的string 和 StringBuider
- C#实现方便又高效的字符串拼接类StringJoiner
- C#拆分字符串工具类
- c#用@拼接字符串的技巧
- 有关C#中字符串拼接和截取
- 线性约束最小方差准则
- pat考试-1138
- jQuery源码学习之对象创建与初始化
- stylesheet_link_tag 用法
- Python:利用内建函数将字符串转化为整数
- C# StringBuider,字符串拼接工具类
- 为什么函数可以返回unique_ptr
- linux操作命令大全
- 【ORACLE】物化视图相关元数据视图字段说明
- 并发编程Future and Callable
- horizon登录过程分析(juno)
- 移动端web开发click touch tap区别
- spring的配置文件信息
- 数据结构--内排序