본문 바로가기
반응형
SMALL

android17

Java에서는 문자열 목록에서 빈 요소를 제거 다음과 같이 빈 문자열을 제거 할 수  있습니다.List list = new ArrayList(Arrays.asList("", "Hi", null, "How"));System.out.println(list);list.removeAll(Arrays.asList("", null));System.out.println(list);Output:[, Hi, null, How][Hi, How] 2024. 10. 10.
Kotlin의 목록에서 null 및 빈 값 제거 이 문서에서는 Kotlin의 목록에서 null, 빈 값, 빈 값을 제거하는 다양한 방법을 살펴봅니다.1. 필터 사용간단한 솔루션은 필터를 사용하여 Kotlin의 목록에서 null, 비어 있는 값 및 공백 값을 제거하는 것입니다. 그만큼 filter() 함수는 지정된 술어와 일치하는 요소를 유지하고, filterNot() 함수는 지정된 술어와 일치하는 요소를 제거합니다.목록에서 null 값만 제거하려면 다음 중 하나를 사용할 수 있습니다. filterNotNull() 기능 또는 mapNotNull() 기능, 아래와 같이: fun main() { val input = listOf("A", "B", null, "", "C", "D", null, "", "E", " ") // 각 println 문은 .. 2024. 10. 10.
[JAVA] Java의 String Empty 와 Blank 체크하기 Empty String Java6 이상부터는 String 클래스의 isEmpty 메소드로 체크하면 됩니다.String test = " ";if (test.isEmpty()) { log.info("isEmpty");} else { log.info("isNotEmpty"); }//결과는 isNotEmpty 가 출력됩니다. test라는 String이 null이 들어올 수 있기 때문에 조건을 추가해준다면 다음과 같이 empty 를 체크하면 됩니다.String test = null;if (test == null || test.isEmpty()) { log.info("isEmpty");} else { log.info("isNotEmpty");}//결과는 isEmpty가 출력됩니다. Java5 .. 2024. 10. 10.
ExpandableList에서 버튼을 클릭할 수 없습니다. ExpandableList에서 group layout에 다음과 같이 버튼을 추가 했더니 버튼은 클릭이 되지만 group  클릭할 수 없는 경우가 있습니다. - list_group.xmlLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:orientation="vertical" android:layout_width="match_parent"    android:layout_height="match_parent">    RelativeLayout        android:layout_width="match_parent"        android:layout_height="wrap_content">       .. 2024. 10. 10.
[구글플레이 개발자 콘솔] 앱 검토에 로그인 사용자 인증 정보 입력 구글 앱을 등록하는 경우에 로그인 버튼이 있으면 로그인 정보를 넣고 심사를 해야 합니다. 만약에 로그인 버튼이 있고 로그인 할 수 있는 아이디 / 비밀번호를 제공 안하면 앱이 등록이 안되니 참고하세요 2024. 10. 10.
반응형
LIST