728x90
반응형
String str = "1+2";
String[] splits = str.split("+");
이렇게 하면 에러임
\\ (역슬래쉬 2개) 넣어줘야함
String str = "1+4+2";
String[] splits = str.split("\\+");
이렇게 해야함
728x90
반응형
'개발일기' 카테고리의 다른 글
Spring (POJO, PSA, AOP, IoC /DI) (0) | 2024.05.13 |
---|---|
컬렉션 프레임워크(collections framework) (0) | 2024.05.13 |
DevOps란 무엇입니까? (0) | 2024.05.07 |
API(Application Programming Interface) (1) | 2024.05.01 |
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project new: Compilation failure: Compilation failure: (0) | 2024.04.30 |