Split

split은 문자열을 나누는 메서드 이다. public static void main(String[] args){ String str = "가,나,다,라"; String[] splitedStr = str.split(","); // splitedStr {"가", "나", "다", "라" } 위와 같이 동작을 하는데, 특정 문자를 넣으면 정상작동하지 않는 것을 볼 수 있다. public static void main(String[] args){ String str = "가.나.다.라"; String[] splitedStr = str.split("."); // 혹은 str = "가|나|다|라"; splitedStr = str.split("|"); } 위와 같이 정상동작하지 않는 것은, split인자로 들어가는..
깡냉쓰
'Split' 태그의 글 목록