This commit is contained in:
sand
2012-08-10 09:23:14 +08:00
parent 81548b0202
commit d17962d5c9
2 changed files with 31 additions and 54 deletions
@@ -3,6 +3,8 @@ package com.alibaba.druid.util;
import java.util.LinkedHashMap;
import java.util.Map;
import com.alibaba.druid.support.logging.Log;
import com.alibaba.druid.support.logging.LogFactory;
import com.alibaba.fastjson.JSON;
/**
@@ -10,6 +12,8 @@ import com.alibaba.fastjson.JSON;
*/
public class StringUtils {
private final static Log LOG = LogFactory.getLog(StringUtils.class);
/**
* Example: subString("12345","1","4")=23
*
@@ -52,6 +56,7 @@ public class StringUtils {
try {
return Integer.parseInt(in);
} catch (NumberFormatException e) {
LOG.warn("stringToInteger fail,string=" + in, e);
return null;
}
}
@@ -67,6 +72,7 @@ public class StringUtils {
try {
return Long.parseLong(in);
} catch (NumberFormatException e) {
LOG.warn("stringToLong fail,string=" + in, e);
return null;
}
}