list로 넘어온 String을 해당정보가 몇개있는지 카운트


list로 넘어온 String을 해당정보가 몇개있는지 카운트

list로 넘어온 String을 해당정보가 몇개있는지 카운트 list로 넘어온 String을 해당정보가 몇개있는지 컨트롤러에서 카운트를 해보겠습니다. trSendstat=2 라는 데이터의 갯수와 trSendstat=4 라는 데이터의 갯수를 확인해보겠습니다. String status = noticeVO.toString(); -> noticeVO안에 담겨져있는 String값을 저장합니다. String status2 = "trSendstat=2"; // 정상일 경우 String status4 = "trSendstat=4"; // 오류/비정상일 경우 -> 카운트할 데이터의 조건을 선언합니다. int count = 0; int counterrstatus = 0; String[] sarr = status.split(", "); -> String값을 ,을 기준으로 split 자릅니다. int len = sarr.length; -> 자른 데이터들의 길이를 int로 선언합니다. for(int i =...


#cnt #count증가 #java #list사용하기 #split #split사용하기 #toString #이클립스 #자바

원문링크 : list로 넘어온 String을 해당정보가 몇개있는지 카운트