Notice
Recent Posts
Recent Comments
반응형
목록2017/09/28 (1)
오늘도 공부
java trim() 이 안먹힐때..
분명 비어있는 데 trim 을 했을 경우 안없어지는 경우가 발생할 수 있다. 그럴경우 아래 함수를 실행해보자.public static String trimAdvanced(String value) { Objects.requireNonNull(value); int strLength = value.length(); int len = value.length(); int st = 0; char[] val = value.toCharArray(); if (strLength == 0) { return ""; } while ((st 0) || (len < strLength)) ? value.substring(st, len) : value; }
링크모음/java
2017. 9. 28. 10:26
