我想知道之间的区别(如果有的话):
StringBuilder sb = new StringBuilder();
sb.Append("xxx");
sb.Append("yyy");
sb.Append("zzz");
和:
StringBuilder sb = new StringBuilder();
sb.Append("xxx")
.Append("yyy")
.Append("zzz");
最佳答案
没有区别,后一种情况称为“Fluent Syntax”。
关于c# - StringBuilder.Append 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1969722/