Android examples for XML:XML String
Simply removes double-quotes from the beginning and end of given XML string
/*// w w w . j a v a2 s .c om * * @file XMLUtil.java * * Copyright (C) 2006-2009 Tensegrity Software GmbH * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License (Version 2) as published * by the Free Software Foundation at http://www.gnu.org/copyleft/gpl.html. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA * * If you are developing and distributing open source applications under the * GPL License, then you are free to use JPalo Modules under the GPL License. For OEMs, * ISVs, and VARs who distribute JPalo Modules with their products, and do not license * and distribute their source code under the GPL, Tensegrity provides a flexible * OEM Commercial License. * * @author Stepan Rutz * * @version $Id: XMLUtil.java,v 1.5 2009/04/29 10:21:58 PhilippBouillon Exp $ * */ //package com.java2s; public class Main { public static void main(String[] argv) throws Exception { String str = "java2s.com"; System.out.println(dequote(str)); } /** * Simply removes double-quotes from the beginning and end of given string * @param str * @return */ public static final String dequote(String str) { if (str.startsWith("\"")) str = str.substring(1); if (str.endsWith("\"")) str = str.substring(0, str.length() - 1); return str; } }