Here you can find the source of getClassName(String string)
public static String getClassName(String string)
//package com.java2s; //License from project: Creative Commons License import java.util.Arrays; import java.util.Iterator; import java.util.List; public class Main { public static String getClassName(String string) { List<String> words = Arrays.asList(string.split(" ")); Iterator wordIterator = words.iterator(); while (wordIterator.hasNext()) if (wordIterator.next().equals("class")) return ((String) wordIterator.next()).replace("{", ""); return null; }//from w w w.j a va 2 s . co m }