Java tutorial
//package com.java2s; public class Main { public static String getInnerCondition(String in) { if (in.contains("[")) { return in.substring(in.lastIndexOf("=\'") + 2, in.lastIndexOf("'")); } else { return in.substring(in.lastIndexOf("/") + 1); } } }