駱駝峯和下劃線兩種命名方式的互轉

import com.google.common.base.CaseFormat;

String s1 = CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, "recordId");
    String s2 = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, "RecordId");
    String s3 = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "RECORD_ID");
    String s4 = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, "RECORD_ID");
    System.out.println(s1);
    System.out.println(s2);
    System.out.println(s3);
    System.out.println(s4);
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章