unquoteString function

String unquoteString(
  1. String s
)

Removes quotes from String s

Implementation

String unquoteString(String s) {
  if (s.length <= 1) return s;

  if ((s.startsWith('"') && s.endsWith('"')) ||
      (s.startsWith("'") && s.endsWith("'"))) {
    return s.substring(1, s.length - 1);
  }

  return s;
}