Java String Dequote dequoteString(String s)

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

Description

dequoteString

License

Open Source License

Parameter

Parameter Description
s a parameter

Declaration

public static String dequoteString(String s) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2015 CA.  All rights reserved.
 *
 * This source file is licensed under the terms of the Eclipse Public License 1.0
 * For the full text of the EPL please see https://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/

public class Main {
    /**/*  www . j  a  va2  s . co  m*/
     * dequoteString
     * @param s
     * @return
     */
    public static String dequoteString(String s) {

        String dequoteStr = s.trim();

        if (dequoteStr.startsWith("'") && dequoteStr.endsWith("'")) {
            dequoteStr = dequoteStr.substring(1);
            dequoteStr = dequoteStr.substring(0, dequoteStr.length() - 1);

            return dequoteStr;
        }

        return s;
    }
}

Related

  1. dequote(String text)
  2. dequote(String value)
  3. dequote(String value)
  4. dequoteFull(String str, char quote)
  5. dequoteIdentifier(String id)
  6. dequoteString(String str)
  7. dequoteString(String str)
  8. dequoteString(String strVal)
  9. deQuoteStringArray(String... quoted)