C# Java 中 StringBuffer 的 .NET 等价物是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11977819/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-09 19:55:13  来源:igfitidea点击:

What is the .NET equivalent of StringBuffer in Java?

c#java.netstring

提问by The Internet

What is the .NET equivalent of java.lang.StringBuffer?

.NET 相当于java.lang.StringBuffer什么?

采纳答案by Jon Skeet

It's System.Text.StringBuilder. Note that in modern Java you'd use java.lang.StringBuildertoo. (It's like StringBuffer, but without the synchronization - I can't remember the last time I wantedthe synchronization of StringBuffer. Note that the .NET StringBuilderisn't thread-safe either, but again, I can't remember the last time I found that to be a problem.)

它是System.Text.StringBuilder。请注意,在现代 Java 中,您也会使用java.lang.StringBuilder。(就像StringBuffer,但没有同步 - 我不记得上次我想要同步 的时间StringBuffer。请注意,.NETStringBuilder也不是线程安全的,但同样,我不记得我最后一次发现成为问题。)