com.sxj.spring.modules.util.CaseFormatUtils.java Source code

Java tutorial

Introduction

Here is the source code for com.sxj.spring.modules.util.CaseFormatUtils.java

Source

/*
 * @(#)CaseFormatUtils.java 20131224 ?23:33:33
 *
 * Copyright (c) 2011-2013 Makersoft.org all rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *
 */
package com.sxj.spring.modules.util;

import org.apache.commons.lang3.StringUtils;

/**
 * Case formats utils.
 */
public class CaseFormatUtils {

    /**
     * camel case convert to under score case
     */
    public static String camelToUnderScore(String camelCase) {
        return StringUtils.join(StringUtils.splitByCharacterTypeCamelCase(camelCase), "_").toLowerCase();
    }
}