且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Kotlin中将新行添加到StringBuilder

更新时间:2022-03-16 07:45:34

Kotlin 1.3+提供了扩展功能可简化任务.

Kotlin 1.3+ provides Extension Function to ease the task.

用法:

val strBuilder = StringBuilder();
strBuilder.appendln("some text");