강의

멘토링

커뮤니티

Inflearn Community Q&A

dayeong's profile image
dayeong

asked

Introduction to Java Algorithm Problem Solving: Coding Test Preparation

9. Extract numbers only

replaceAll 을 이용해서 문제를 풀어도 문제는 없나요 ?

Written on

·

445

2

java코테 준비 같이 해요!

Answer 3

0

public int solution(String str) {
String answer = "";

answer = str.replaceAll("[a-z]|[A-Z]","");

return Integer.parseInt(answer);
}

저랑 같은 방법이시네요!

0

오우 이런 방법이;

0

codingcamp님의 프로필 이미지
codingcamp
Instructor

안녕하세요^^

네. 상관없습니다.

dayeong's profile image
dayeong

asked

Ask a question