Android examples for XML:XML Element
get Element Value from Element String
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { String element = "java2s.com"; System.out.println(getElementValue(element)); }//w ww. jav a 2s .co m public static String getElementValue(String element) { int startIndex = element.indexOf('>') + 1; int endIndex = element.indexOf("</"); return element.substring(startIndex, endIndex); } }