StringBuilder做函数参数
2016-03-15 12:13
281 查看
StringBuilder做函数参数:
输出结果:
static void Main(string[] args) { StringBuilder sb = new StringBuilder(); Hello(sb);//StringBuilder做为方法参数使用时不需要赋值,其使用相当于 out str Console.WriteLine(sb.ToString()); string str; World(out str); Console.WriteLine(str); Console.ReadKey(); } public static void Hello(StringBuilder sb) { sb.Append("StringBuilder Hello World"); } public static void World(out string str) { str = "string Hello World"; }
输出结果:
![](http://images2015.cnblogs.com/blog/715141/201603/715141-20160315122209662-1865583578.png)
相关文章推荐
- UIScrollView基本使用
- UIView常用的一些方法小记之setNeedsDisplay和setNeedsLayout
- 掉UItableview headerview黏性
- SQLAlchemy 做migration的时候 ValueError: too many values to unpack
- UITableView 隐藏多余Cell的分割线
- 基于modern ui for wpf的在线公开课平台 之五 使用ListBox实现图片列表效果
- UITableView常见属性
- 【转】android UI设计的一些心得与问题解决(无效果图)
- Day3.4--Android简单UI控件之ImageView以及ScaleType的使用
- Android UI 之时间与日期控件
- Android UI控件自动提示控件(AutoCompleteTextView)
- Android UI控件Spinner控件的学习
- Android UI开发之RadioButton
- Android UI 优化——使用HierarchyViewer工具
- String, StringBuilder与StringBuffer的区别
- 192 - Word Frequency
- String,StringBuffer与StringBuilder的区别??[转]
- <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %>
- UILable的换行
- 使用妹子UI开发的体验分享