Java tutorial
//package com.java2s; public class Main { public static String getPathToFirstList(String attributePath) { if (attributePath != null && attributePath.contains("[")) { //$NON-NLS-1$ return attributePath.substring(0, attributePath.indexOf("[")); } else { return null; } } }