| | |
| | | package com.ycl.utils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.DecimalFormat; |
| | | |
| | | public class StringUtils { |
| | | |
| | | /** |
| | |
| | | * hello_world=>helloWorld |
| | | * HELLO_WORLD=>helloWorld |
| | | * Hello_World=>helloWorld |
| | | * |
| | | * @param content |
| | | * @return |
| | | */ |
| | | public static String underlineToLowerCamelCase(String content) { |
| | | return new StringBuilder(16) |
| | | .append(content.substring(0,1).toLowerCase()) |
| | | .append(content.substring(1).replaceAll("_([a-zA-Z])","$1".toUpperCase())) |
| | | .append(content.substring(0, 1).toLowerCase()) |
| | | .append(content.substring(1).replaceAll("_([a-zA-Z])", "$1".toUpperCase())) |
| | | .toString(); |
| | | } |
| | | |
| | |
| | | * hello_world=>HelloWorld |
| | | * HELLO_WORLD=>HelloWorld |
| | | * Hello_World=>HelloWorld |
| | | * |
| | | * @param content |
| | | * @return |
| | | */ |
| | |
| | | .toString(); |
| | | } |
| | | |
| | | |
| | | public static String doubleTwo(Double value) { |
| | | return String.format("%.2f", value); |
| | | } |
| | | } |