public class Test {
/**
* @param args
*/
public static void main(String[] args) {
String[] attr =
new String[] {"Student_ID", "Study_NO"};
String[] annotation =
new String[] {"先生ID", "勉強番号"};
for (int i = 0; i < attr.length; i++) {
String strAttr = attr[i].toLowerCase();
String strAnn = annotation[i];
while (strAttr.indexOf('_') != -1) {
int index = strAttr.indexOf('_');
strAttr = strAttr.replaceFirst("_", "");
String first = strAttr.substring(0, index);
String bigChar =
String.valueOf(strAttr.charAt(index)).toUpperCase();
String end = strAttr.substring(index + 1);
strAttr = first
+ bigChar
+ end;
}
StringBuffer sb = new StringBuffer();
sb.append(" /**\n");
sb.append(" * "
+ strAnn
+ "\n");
sb.append(" */\n");
sb.append(" private String "
+ strAttr
+ ";\n");
System.out.println(sb);
}
}
}
/**
* @param args
*/
public static void main(String[] args) {
String[] attr =
new String[] {"Student_ID", "Study_NO"};
String[] annotation =
new String[] {"先生ID", "勉強番号"};
for (int i = 0; i < attr.length; i++) {
String strAttr = attr[i].toLowerCase();
String strAnn = annotation[i];
while (strAttr.indexOf('_') != -1) {
int index = strAttr.indexOf('_');
strAttr = strAttr.replaceFirst("_", "");
String first = strAttr.substring(0, index);
String bigChar =
String.valueOf(strAttr.charAt(index)).toUpperCase();
String end = strAttr.substring(index + 1);
strAttr = first
+ bigChar
+ end;
}
StringBuffer sb = new StringBuffer();
sb.append(" /**\n");
sb.append(" * "
+ strAnn
+ "\n");
sb.append(" */\n");
sb.append(" private String "
+ strAttr
+ ";\n");
System.out.println(sb);
}
}
}