| | |
| | | package com.moral.common.util; |
| | | |
| | | import com.mysql.jdbc.TimeUtil; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import org.apache.commons.lang3.Conversion; |
| | | |
| | | /** |
| | | * |
| | | * 功能描述: string 工具类 |
| | | * @author: fengxiang |
| | | * @date: 2018/7/30 10:53 |
| | | */ |
| | | public class StringUtils { |
| | | public static final char UNDERLINE = '_'; |
| | | public static final String NULL = "null"; |
| | | |
| | | /** |
| | | * 驼峰格式字符串转换为下划线格式字符串 |
| | |
| | | return sb.toString(); |
| | | } |
| | | public static boolean isNullOrEmpty(String toTest) { |
| | | return toTest == null || toTest.length() == 0; |
| | | return toTest == null || toTest.length() == 0 || NULL.equals(toTest); |
| | | } |
| | | public static Object stringToObject4Type(Class<?> type,String value) throws Exception{ |
| | | Object result = value; |
| | |
| | | } |
| | | public static boolean isNumericZidai(String str) { |
| | | for (int i = 0; i < str.length(); i++) { |
| | | System.out.println(str.charAt(i)); |
| | | //System.out.println(str.charAt(i)); |
| | | if (!Character.isDigit(str.charAt(i))) { |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | } |