CaseFormat

来源:互联网 发布:php web 文件上传 编辑:程序博客网 时间:2024/05/22 15:20

import com.google.common.base.CaseFormat;


/**
 * @author Andypan
 * @CaseFormatTest.java
 * @{describe}
 * @date 2017年7月26日 下午4:44:01
 */
public class CaseFormatTest
{
public static void main(String[] args)
{
String a = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "CONSTANT_NAME"); // returns
String b = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, "constantName"); // returns
// "constantName"
System.out.println(a);
System.out.println(b);
}


}
原创粉丝点击