unquote property

String get unquote

Remove leading/trailing quotes (single or double) if present.

Implementation

String get unquote {
  if (length >= 2) {
    final a = this[0], b = this[length - 1];
    if ((a == '"' && b == '"') || (a == "'" && b == "'")) {
      return substring(1, length - 1);
    }
  }
  return this;
}