用于高效地串联字符串。
允许使用write*()方法增加构建字符串。 只有当toString被调用时,所有字符串才会被串联成单一的字符串。
- Implements
Constructors
- StringBuffer([Object content = ""])
-
使用初始化内容创建字符串缓冲区。
Properties
- hashCode → int
-
获取对象的哈希值。
read-only, inherited - isEmpty → bool
-
返回缓冲区是否为空。这是一个固定时间的操作。
read-only - isNotEmpty → bool
-
返回缓冲区是否不为空。这是一个固定时间的操作。
read-only - length → int
-
返回到目前为止积存的内容的长度。 这是一个固定时间的操作。
read-only - runtimeType → Type
-
表示对象的运行时类型。
read-only, inherited
Operators
-
operator ==(
other) → bool -
相等操作符。
inherited
Methods
-
clear(
) → void -
清空字符串缓冲区。
-
noSuchMethod(
Invocation invocation) → dynamic -
当一个不存在的函数或成员变量被访问时,该函数被调用。
inherited -
toString(
) → String -
将串联的字符串作为缓冲区的内容返回。
-
write(
Object obj) → void -
将
obj
转换成字符串,添加到缓冲区中。 -
writeAll(
Iterable objects, [String separator = ""]) → void -
遍历
objects
,并将结果写入序列。 -
writeCharCode(
int charCode) → void -
将
charCode
表示的字符串添加到缓冲区中。 -
writeln(
[Object obj = ""]) → void -
通过调用
Object.toString
,将obj
转换成字符串并添加this
中, 后面跟着一个换行符(10)。