1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 19:22:22 -05:00

Fix bug in removeQuotes

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1722 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2011-06-28 21:12:46 +00:00
parent a2e8f1f07d
commit 9b8888c014

View File

@ -388,16 +388,19 @@ public final class StringUtil {
/**
* Remove quotes if present on value.
*
* @param value input value
* @return unquoted string
*/
public static String removeQuotes(String value) {
String result = value;
if (result.startsWith("\"") || result.startsWith("{") || result.startsWith("(")) {
result = result.substring(1);
}
if (result.endsWith("\"") || result.endsWith("}") || result.endsWith(")")) {
result = result.substring(0, result.length() - 1);
if (result != null) {
if (result.startsWith("\"") || result.startsWith("{") || result.startsWith("(")) {
result = result.substring(1);
}
if (result.endsWith("\"") || result.endsWith("}") || result.endsWith(")")) {
result = result.substring(0, result.length() - 1);
}
}
return result;
}