Here you can find the source of unquote(String name)
Parameter | Description |
---|---|
name | The name to be unquoted. |
public static String unquote(String name)
//package com.java2s; //License from project: Apache License public class Main { /**// w w w . j a v a 2 s. c o m * Return the unquoted version of name (stripping the start and end '`' characters if present). * * @param name The name to be unquoted. * @return The unquoted version. */ public static String unquote(String name) { return isQuoted(name) ? name.substring(1, name.length() - 1) : name; } /** * Determine if the given string is quoted (wrapped by '`' characters at beginning and end). * * @param name The name to check. * @return True if the given string starts and ends with '`'; false otherwise. */ public static boolean isQuoted(String name) { return name != null && name.length() != 0 && ((name.charAt(0) == '`' && name.charAt(name.length() - 1) == '`') || (name.charAt(0) == '"' && name.charAt(name.length() - 1) == '"')); } }