Usage
It is used to switch a string between the camper style and the underline style. It may be useless to the average person, and it may be helpful for the person who writes the ORM framework.
Example:
Company_name-> companyName
Add the following dependencies to Pom. XML for Installation
<dependency> <groupId>org.crazycake</groupId> <artifactId>camel-name-utils</artifactId> <version>1.0.0-RELEASE</version></dependency>
Usage
@Testpublic void testCamel2underscore() { String underscoreName = CamelNameUtils.camel2underscore("AaaBbb"); assertThat(underscoreName, is("aaa_bbb"));}@Testpublic void testUnderscore2camel() { String camelName = CamelNameUtils.underscore2camel("user_name"); assertThat(camelName,is("userName"));}@Testpublic void testCapitalize() { String capitalName = CamelNameUtils.capitalize("student"); assertThat(capitalName,is("Student"));}
The above introduction may expire at any time, the latest version of the project home page for https://github.com/alexxiyang/camel-name-utils
Camel-name-utils switching between camel style and underline style