quote_buffer 0.0.1 copy "quote_buffer: ^0.0.1" to clipboard
quote_buffer: ^0.0.1 copied to clipboard

outdated

Simplifies adding strings whose content is delimited by escaped quotation marks to Dart's string buffer.

example/example.dart

import 'package:quote_buffer/quote_buffer.dart';

// To run this program go to the folder 'quote_buffer/example'
// in your terminal and type
//
// # dart example.dart
//
// followed by enter.
main(List<String> args) {
  List<String> strings = ['one', 'two', 'three', 'four'];
  strings.addAll(args);

  var buffer = QuoteBuffer();

  // Adds:'\'1\'' (Note: Objects are first converted to strings.)
  buffer.writeQ(1);

  // Adds a new line
  buffer.writeln('');

  // Adds:'\'name\'\n'
  buffer.writelnQ('name');

  // Adds:'\'one,two,three,four\''
  buffer.writeAllQ(strings, ',');

  // Adds a new line
  buffer.writeln('');

  // Adds:'\'======\'\n'
  buffer.writelnQ('======');

  // Adds:
  // '\'one\';\n'
  // '\'two\';\n'
  // '\'three\';\n''
  // '\'four\'\n'
  buffer.writelnAllQ(strings, ';');

  // Prints:
  // 'name'
  // 'one,two,three,four'
  // '======'
  // 'one';
  // 'two';
  // 'three';
  // 'four'
  print(buffer.toString());

  buffer = QuoteBuffer(
    delimiter: QuotationMark.Double,
  );

  // Adds:
  // '\"one\"'
  // '\"two\"'
  // '\"three\"'
  // '\"four\"'
  buffer.writeAllQ(strings, ',');

  // Prints:
  // "one,two,three,four"
  print(buffer.toString());
}
0
likes
0
pub points
52%
popularity

Publisher

verified publishersimphotonics.com

Simplifies adding strings whose content is delimited by escaped quotation marks to Dart's string buffer.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

built_collection, generic_enum

More

Packages that depend on quote_buffer