Camel-name-utils switching between camel style and underline style

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.