quote static method

String quote(
  1. String string
)

Implementation

static String quote(String string) {
  var specialChars = [",", "+", "=", "\n", "<", ">", "#", ";", "\\"];
  for (var specialChar in specialChars) {
    if (string.contains(specialChar)) {
      return "\"" + string + "\"";
    }
  }
  return string;
}