Java String Unquote unquote(String string)

Here you can find the source of unquote(String string)

Description

Ensure that the string is not surrounded by quotes.

License

Open Source License

Parameter

Parameter Description
string a parameter

Declaration

private static final String unquote(String string) 

Method Source Code

//package com.java2s;
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

public class Main {
    /**/*w w  w .  j  a  v  a  2s .  c  o  m*/
    *
    * Ensure that the string is not surrounded by quotes.
    *
    * @param string
    * @return
    */
    private static final String unquote(String string) {
        if (string.startsWith("\"")) {
            string = string.substring(1);
        }
        if (string.endsWith("\"")) {
            string = string.substring(0, string.length() - 1);
        }
        return string;
    }
}

Related

  1. unquote(String string)
  2. unquote(String string)
  3. unquote(String string)
  4. unquote(String string)
  5. unquote(String string)
  6. unquote(String string)
  7. unquote(String string, char quote)
  8. unquote(String text)
  9. unquote(String text)