Camel-name-utils switches between the camel style and the underline style, and camelbak

Source: Internet
Author: User

Camel-name-utils switches between the camel style and the underline style, and camelbak
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


What is the underline in list_name of a mysql Command?

_ As a naming format, it is used to separate words.
Naming styles in programming languages are generally
1. Pascal style similar to ListName
2. The camper style is similar to listName.
3. Similar to _ listName starting _
4. Use _ to distinguish the word list_name

Php can underline the variable dollar sign.

It looks good from the syntax perspective.
However, we recommend that you do not do this.
PHP uses this rule to name some system variables, such
$ _ POST, $ _ SESSION, $ _ REQUEST
It's not confusing to name some business variables?

We recommend that you use the hump method to name your own variables, such as $ myBook, $ whatDoYouWant, $ numThisYear
This is a JAVA 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.