java 구분자(split)로 구별해서 LIST에 넣어주기

public static ArrayList convertStrToArr(String str) {
String[] item = str.split(",");
ArrayList arrItem = new ArrayList();
if(str!=null && !str.equals("") ) {
if(str.lastIndexOf(",")!=-1) {
for(int i=0;i<item.length;i++){
arrItem.add(item[i]);
}
} else {
arrItem.add(str);
}
}
return arrItem;
}

댓글

이 블로그의 인기 게시물

오라클 DB 특정 컬럼의 특정 값만 카운트 하는 법

DB 툴 토드(TOAD) 단축키