https://www.codewars.com/kata/57a37f3cbb99449513000cd8
Codewars - Achieve mastery through coding practice and developer mentorship
A coding practice website for all programming levels – Join a community of over 3 million developers and improve your coding skills in over 55 programming languages!
www.codewars.com
DESCRIPTION:
Write a function which removes from string all non-digit characters and parse the remaining to number. E.g: "hell5o wor6ld" -> 56
Function:
getNumberFromString(s)
코드
function getNumberFromString(s) {
return Number(s.replace(/\D/g, ''));
}
'알고리즘 > Codewars' 카테고리의 다른 글
[Codewars] Simple validation of a username with regex (8 kyu) / JavaScript (0) | 2023.04.25 |
---|---|
[백준] 26529: Bunnies / Node.js (JavaScript) (0) | 2023.04.25 |
[Codewars] Two Sum (6 kyu) / JavaScript (0) | 2023.04.24 |
[Codewars] Mexican Wave (6 kyu) / JavaScript (0) | 2023.04.24 |
[Codewars] Weight for weight (5 kyu) / JavaScript (0) | 2023.04.23 |
댓글