반응형 필드명1 Fileld명을 테이블 컬럼명으로 바꾸자 가끔 이런것이 필요할 때가 있다.userId 를 USER_ID 로 바꾸는 기능.public class Test { public static void main(String[] args) throws Exception { String regex = "([a-z])([A-Z])"; String replacement = "$1_$2"; String str = "UserId"; String value = ""; value = str.replaceAll(regex, replacement).toUpperCase(); System.out.println(value); }} 2013. 4. 6. 이전 1 다음 728x90 반응형