Java String Unquote unquote(String value)

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

Description

Given a string, which is quoted with double quotes, returns the contents, without the double quotes.

License

Open Source License

Parameter

Parameter Description
value a parameter

Return

The contents of the quoted string.

Declaration

public static String unquote(String value) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//  w  ww. ja v  a  2  s  . c  o  m
     * Given a string, which is quoted with double quotes, returns the contents, without the double quotes.
     * 
     * @param value
     * @return The contents of the quoted string.
     */
    public static String unquote(String value) {
        if (value.startsWith("\'") && (value.endsWith("\'"))) {
            return value.substring(1, value.length() - 1).replaceAll("\\\'", "'");
            // Replace all \' slash quote with " quote
        }
        return value;
    }
}

Related

  1. unquote(String val)
  2. unquote(String value)
  3. unquote(String value)
  4. unquote(String value)
  5. UnQuote(String value)
  6. unquote(String value)
  7. unquote(String value)
  8. unquoteAtom(String atom)
  9. unquoteCharacterLiteral(String charLiteralStr)