강의

멘토링

로드맵

Inflearn Community Q&A

qazaq1096407's profile image
qazaq1096407

asked

Introduction to Javascript Algorithm Problem Solving (Coding Test Preparation)

3. Extract only numbers

이렇게 한것도 괜찮나요

Written on

·

312

0

안녕하세요 선생님 이렇게 했는데 괜찮나요 

function solution(str){

    let haha= str.replace(/[a-z]/gi, "").replace(/(^0+)/, "");

           return haha ;

 }

            

            let str="g0000en2T0sfdjsifjwep0if32uufklnfwfe8eSoft";

            console.log(solution(str));

javascript코테 준비 같이 해요!

Quiz

The primary method mentioned in the lecture for checking if a string is a palindrome using built-in functions is to reverse the string and compare it with the original.

`split`, `sort`, `join`

`substring`, `reverse`, `concat`

`split`, `reverse`, `join`

`slice`, `sort`, `merge`

Answer 1

0

codingcamp님의 프로필 이미지
codingcamp
Instructor

안녕하세요^^

네. 정규식을 써도 좋습니다.

qazaq1096407's profile image
qazaq1096407

asked

Ask a question