string 转化成 string数组

public static String[] stringInArrays(String fields) {
String[] field = null;
if (fields != null && fields.length() > 0) {
field = fields.split(",");
String first = field[0];
field[0] = first.substring(first.indexOf("[") + 1);
String last = field[field.length - 1];
field[field.length - 1] = last.substring(0, last.indexOf("]"));


}
return field;
}
posted @ 2019-07-06 15:34  zzl0916  阅读(11076)  评论(0编辑  收藏  举报