Here you can find the source of deQuote(String in)
Parameter | Description |
---|---|
in | a quoted string |
in
is not quoted, the original string is returned.
public static String deQuote(String in)
//package com.java2s; public class Main { /**//from w w w . ja v a2 s . co m * Removes quotes from a string * * @param in a quoted string * @return the string without enclosing quotes; if <code>in</code> is not * quoted, the original string is returned. */ public static String deQuote(String in) { int len = in.length(); if (in.charAt(0) == '\"' && in.charAt(len - 1) == '\"') { if (len > 2) { return in.substring(1, len - 1); } else { return ""; } } return in; } }