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.