[JAVA] String -> String[] 만들기
2021. 1. 22. 15:52
자바
String id = (String) params.get("id"); String[] delChkArray = id.split(","); for (int i = 0; i < delChkArray.length; i++) { System.out.println(delChkArray[i]); }
[JAVA] json -> map, map -> json 변환
2021. 1. 22. 15:48
자바
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);
[JAVA] 몇번째 문자열 바꾸는 기능
2019. 2. 12. 13:19
자바
StringBuilder newIdName = new StringBuilder("TISTORY"); newIdName.setCharAt(3, '*'); newIdName.setCharAt(4, '*'); newIdName.setCharAt(5, '*'); System.out.println(newIdName ); 결과값 : TIS***Y