unquote a string - Android java.lang

Android examples for java.lang:String Convert

Description

unquote a string

Demo Code


public class Main{


    public static String unquote(String s, String quote) {
        if (s != null && quote != null) {
            if (s.startsWith(quote) && s.endsWith(quote)) {
                return s.substring(1, s.length() - quote.length());
            }//from  ww w  .j av a2 s .c  o m
        }
        return s;
    }

}

Related Tutorials