Java String Unquote unquote(String s)

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

Description

Removes enclosinf apostrophes from the given string

License

Open Source License

Parameter

Parameter Description
s the string to be unquoted

Return

the unquoted string

Declaration

public static String unquote(String s) 

Method Source Code

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

public class Main {
    /**//w w w.j  ava  2s . c om
     * Removes enclosinf apostrophes from the given string
     * @param s the string to be unquoted
     * @return the unquoted string
     */
    public static String unquote(String s) {
        if (s.contains("'")) {
            return s.substring(s.indexOf("'") + 1, s.lastIndexOf("'"));
        } else {
            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)
  7. unquote(String s)
  8. unquote(String s, char c)
  9. unquote(String str)