String (String x, int offset) { int idx = offset; while (idx > 0 && idx < x.length() && !Character.isUpperCase(x.charAt(idx))) { idx = x.indexOf('.', idx) + 1; } return x.substring(Math.max(idx, offset)); }