writeEnclosed method

void writeEnclosed([
  1. Object? object,
  2. String enclosing = "'"
])

Adds object, enclosed by enclosing, to this buffer.

final buffer = StringBuffer()..writeEnclosed('hello world');
buffer.toString(); // "'hello world'"

Implementation

void writeEnclosed([Object? object, String enclosing = "'"]) => this..write(enclosing)..write(object)..write(enclosing);