Java String Unquote unquote(String s)

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

Description

remove double quotes around a string

License

Open Source License

Parameter

Parameter Description
s a parameter

Declaration

public static String unquote(String s) 

Method Source Code

//package com.java2s;
/** /*from   w  w  w  .j a  v a 2  s.co m*/
 * Copyright (c) 2012 by JP Moresmau
 * This code is made available under the terms of the Eclipse Public License,
 * version 1.0 (EPL). See http://www.eclipse.org/legal/epl-v10.html
 */

public class Main {
    /**
     * remove double quotes around a string
     * @param s
     * @return
     */
    public static String unquote(String s) {
        if (s != null && s.length() > 1) {
            if (s.charAt(0) == '\"' && s.charAt(s.length() - 1) == '\"') {
                s = s.substring(1, s.length() - 1);
            }
        }
        return s;
    }
}

Related

  1. unquote(String s)
  2. unquote(String s)
  3. unquote(String s)
  4. unquote(String s)
  5. unquote(String s)
  6. unquote(String s, char c)
  7. unquote(String str)
  8. unquote(String str)
  9. unquote(String str)