> java 读取json文件转换成list
File file = new File("F:\\test01.json");
JSONArray jsonArray = JSONUtil.readJSONArray(file, StandardCharsets.UTF_8);
List<Match01Vo> qxppNoMatch01List = JSONObject.parseArray(jsonArray.toString(), match01Vo.class);
> 用指定字符串,指定长度填充字符串(左边填充)
/**
* 用指定字符,指定长度,为指定的字符串填充字符串(左边)
*
* @param str String 原始字符
* @param c char 填充的字符
* @param len int 字符串长度
* @return
*/
public static String fillStringLeft(String str, String c, int len) {
if (str == null) {
str = "";
}
int strLen = str.getBytes().length;
len = len - strLen;
if (len <= 0) {
return str;
}
while (len > 0) {
str = c + str;
len--;
}
return str;
}