[JAVA] String -> String[] 만들기 String id = (String) params.get("id"); String[] delChkArray = id.split(","); for (int i = 0; i < delChkArray.length; i++) { System.out.println(delChkArray[i]); } backend/자바 4년 전
[JAVA] json -> map, map -> json 변환 json -> map 변환 import com.fasterxml.jackson.databind.ObjectMapper; ObjectMapper mapper = new ObjectMapper(); Map map = mapper.readValue(jsonStr, Map.class); map -> json 변환 import com.fasterxml.jackson.databind.ObjectMapper; ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(map); json = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(map); backend/자바 4년 전
[JAVA] 몇번째 문자열 바꾸는 기능 StringBuilder newIdName = new StringBuilder("TISTORY"); newIdName.setCharAt(3, '*'); newIdName.setCharAt(4, '*'); newIdName.setCharAt(5, '*'); System.out.println(newIdName ); 결과값 : TIS***Y backend/자바 6년 전