Returns True if the string begins and ends with quotes (single or double)

        :param s: a string
        :return: boolean
499923
def is_quoted(s):
    
    return (s.startswith("'") and s.endswith("'")) or (s.startswith('"') and s.endswith('"'))
847843
static private boolean hasOddNumberOfSingleQuotes(String str) {
        boolean result = false;
        for (int index = str.indexOf("'"); index > -1; index = str.indexOf("'", index+1)) {
            result = !result;
        }
        return result;
    }
812796
def from_string(cls, s):
        
        def _qstrip(s):
            return s[1:-1]  # remove assumed quote characters
        tokens = []
        for match in _yy_re.finditer(s):
            d = match.groupdict()
            lnk, pos = None, []
            if d['lnkfrom'] is not None:
                lnk = Lnk.charspan(d['lnkfrom'], d['lnkto'])
            if d['pos'] is not None:
                ps = d['pos'].strip().split()
                pos = list(zip(map(_qstrip, ps[::2]), map(float, ps[1::2])))
            tokens.append(
                YyToken(
                    int(d['id']),
                    int(d['start']),
                    int(d['end']),
                    lnk,
                    list(map(int, d['paths'].strip().split())),
                    _qstrip(d['form']),
                    None if d['surface'] is None else _qstrip(d['surface']),
                    int(d['ipos']),
                    list(map(_qstrip, d['lrules'].strip().split())),
                    pos
                )
            )
        return cls(tokens)
604614
private String strEscape(
      String s,
      String doublequoteEscape,
      String singlequoteEscape,
      String backtickEscape,
      String backslashEscape,
      String dollarEscape,
      boolean useSlashV,
      boolean isRegexp) {
    StringBuilder sb = new StringBuilder(s.length() + 2);
    for (int i = 0; i < s.length(); i++) {
      char c = s.charAt(i);
      switch (c) {
        case '\0': sb.append("\\x00"); break;
        case '\u000B':
          if (useSlashV) {
            sb.append("\\v");
          } else {
            sb.append("\\x0B");
          }
          break;
        // From the SingleEscapeCharacter grammar production.
        case '\b': sb.append("\\b"); break;
        case '\f': sb.append("\\f"); break;
        case '\n': sb.append("\\n"); break;
        case '\r': sb.append("\\r"); break;
        case '\t': sb.append("\\t"); break;
        case '\\': sb.append(backslashEscape); break;
        case '\"': sb.append(doublequoteEscape); break;
        case '\'': sb.append(singlequoteEscape); break;
        case '$': sb.append(dollarEscape); break;
        case '`': sb.append(backtickEscape); break;

        case '=':
          // '=' is a syntactically significant regexp character.
          if (trustedStrings || isRegexp) {
            sb.append(c);
          } else {
            sb.append("\\x3d");
          }
          break;

        case '&':
          if (trustedStrings || isRegexp) {
            sb.append(c);
          } else {
            sb.append("\\x26");
          }
          break;

        case '>':
          if (!trustedStrings && !isRegexp) {
            sb.append(GT_ESCAPED);
            break;
          }

          // Break --> into --\> or ]]> into ]]\>
          //
          // This is just to prevent developers from shooting themselves in the
          // foot, and does not provide the level of security that you get
          // with trustedString == false.
          if (i >= 2
              && ((s.charAt(i - 1) == '-' && s.charAt(i - 2) == '-')
                  || (s.charAt(i - 1) == ']' && s.charAt(i - 2) == ']'))) {
            sb.append(GT_ESCAPED);
          } else {
            sb.append(c);
          }
          break;
        case '<':
          if (!trustedStrings && !isRegexp) {
            sb.append(LT_ESCAPED);
            break;
          }

          // Break </script into <\/script
          // As above, this is just to prevent developers from doing this
          // accidentally.
          final String endScript = "/script";

          // Break <!-- into <\!--
          final String startComment = "!--";

          if (s.regionMatches(true, i + 1, endScript, 0, endScript.length())) {
            sb.append(LT_ESCAPED);
          } else if (s.regionMatches(false, i + 1, startComment, 0, startComment.length())) {
            sb.append(LT_ESCAPED);
          } else {
            sb.append(c);
          }
          break;

        default:
          if (isRegexp
              || !outputFeatureSet.contains(Feature.UNESCAPED_UNICODE_LINE_OR_PARAGRAPH_SEP)) {
            // In 2019 these characters (line and paragraph separators) are valid in strings but
            // not regular expressions.
            // https://github.com/tc39/proposal-json-superset
            if (c == '\u2028') {
              sb.append("\\u2028");
              break;
            }
            if (c == '\u2029') {
              sb.append("\\u2029");
              break;
            }
          }

          if ((outputCharsetEncoder != null && outputCharsetEncoder.canEncode(c))
              || (c > 0x1f && c < 0x7f)) {
            // If we're given an outputCharsetEncoder, then check if the character can be
            // represented in this character set. If no charsetEncoder provided - pass straight
            // Latin characters through, and escape the rest. Doing the explicit character check is
            // measurably faster than using the CharsetEncoder.
            sb.append(c);
          } else {
            // Other characters can be misinterpreted by some JS parsers,
            // or perhaps mangled by proxies along the way,
            // so we play it safe and Unicode escape them.
            Util.appendHexJavaScriptRepresentation(sb, c);
          }
      }
    }
    return sb.toString();
  }
1124817
def startswith_strip(s, startswith='http://', ignorecase=True):
    
    if ignorecase:
        if s.lower().startswith(startswith.lower()):
            return s[len(startswith):]
    else:
        if s.endswith(startswith):
            return s[len(startswith):]
    return s
538609
function(str) {
    return (_.startsWith(str, '"') && _.endsWith(str, '"') && !_.includes(_.trim(str, '"'), '"')) ||
      (_.startsWith(str, "'") && _.endsWith(str, "'") && !_.includes(_.trim(str, "'"), "'"))
  }
652100
public static boolean endsWith(CharSequence s, char c) {
        int len = s.length();
        return len > 0 && s.charAt(len - 1) == c;
    }
1085578
def unescape(s, quote=False):
    
    s = s.replace('&lt;', '<')
    s = s.replace('&gt;', '>')
    if quote:
        s = s.replace('&quot;', '"')
    s = s.replace('&amp;', '&')
    return s
1270845
function endsWith(str, ending) {
        if (str.length - ending.length === str.lastIndexOf(ending))
            return true;
        else return false;
    }
939312
public static String quote(String s) {
        StringBuilder buf = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            buf.append(quote(s.charAt(i)));
        }
        return buf.toString();
    }
571012
public static String stripDoubleQuotes(String s)
    {
        String ret = s;
        if(hasDoubleQuotes(s))
            ret = s.substring(1, s.length()-1);
        return ret;
    }
1364392
def sql_dequote_string(s: str) -> str:
    
    if len(s) < 2 or s[0] != SQUOTE or s[-1] != SQUOTE:
        raise ValueError("Not an SQL string literal")
    s = s[1:-1]  # strip off the surrounding quotes
    return s.replace(DOUBLE_SQUOTE, SQUOTE)
69682
function isQuotedString(str) {
  var is = false;
  if(typeof str === 'string') {
    var firstChar = str.charAt(0);
    is = (['"', "'", '`'].indexOf(firstChar) !== -1);
  }
  return is;
}
185488
function string_starts_with(str, what) {
		return (str.substr(0, what.length) === what) ? true : false;
	}
438728
def startswith(self, prefix, start=None, end=None):
        
        prefix = Bits(prefix)
        start, end = self._validate_slice(start, end)
        if end < start + prefix.len:
            return False
        end = start + prefix.len
        return self._slice(start, end) == prefix
1311335
private static boolean needsQuote(String value) {
        if (null == value)
            return true;
        int len = value.length();
        if (0 == len) {
            return true;
        }
        if ('"' == value.charAt(0)) {
            if ('"' == value.charAt(len - 1)) {
                // already wrapped with quotes
                return false;
            }
            // we now know this has a quote (special char) in it, so return now
            return true;
        }

        for (int i = 0; i < len; i++) {
            char c = value.charAt(i);
            if (c < 0x20 || c >= 0x7f || TSPECIALS.indexOf(c) != -1) {
                return true;
            }
        }
        return false;
    }
291095
public static boolean isStateCode(String s) {
        if (isEmpty(s)) return defaultEmptyOK;
        return ((USStateCodes.indexOf(s) != -1) && (s.indexOf(USStateCodeDelimiter) == -1));
    }