Java String Unquote unquoteString(String s)

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

Description

unquote String

License

Open Source License

Declaration

public static final String unquoteString(String s) 

Method Source Code

//package com.java2s;

public class Main {
    public static final String unquoteString(String s) {
        if (s.charAt(0) == '\"') {
            if (s.charAt(s.length() - 1) == '\"') {
                return (s.substring(1, s.length() - 1));
            }//from w  ww.j a  v a 2s  .  c  om

            return (s.substring(1, s.length() - 0));
        }

        if (s.charAt(s.length() - 1) == '\"') {
            return (s.substring(1, s.length() - 1));
        }

        return (s);
    }
}

Related

  1. unquotePath(String path)
  2. unquoteS(String s)
  3. unquoteString(final String input)
  4. unquoteString(String s)
  5. unquoteString(String s)
  6. unquoteString(String value)
  7. unquoteText(String s)
  8. unquoteXML(String xmlFragment)