01: package org.vraptor.reflection;
02:
03: import java.beans.Introspector;
04:
05: public class StringUtil {
06:
07: public static String classNameToInstanceName(String name) {
08: return Introspector.decapitalize(name);
09: }
10:
11: public static String removeEnding(String string,
12: String[] terminations) {
13: for (String ending : terminations) {
14: if (string.endsWith(ending)) {
15: return string.substring(0, string.length()
16: - ending.length());
17: }
18: }
19: return string;
20: }
21: }
|