https://www.codewars.com/kata/57e1e61ba396b3727c000251
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:
Your boss decided to save money by purchasing some cut-rate optical character recognition software for scanning in the text of old novels to your database. At first it seems to capture words okay, but you quickly notice that it throws in a lot of numbers at random places in the text.
Examples (input -> output)
'! !' -> '! !'
'123456789' -> ''
'This looks5 grea8t!' -> 'This looks great!'
Your harried co-workers are looking to you for a solution to take this garbled text and remove all of the numbers. Your program will take in a string and clean out all numeric characters, and return a string with spacing and special characters ~#$%^&!@*():;"'.,? all intact.
코드
function stringClean(s){
return s.replace(/[0-9]/g, "");
}
'알고리즘 > Codewars' 카테고리의 다른 글
[Codewars] Remove anchor from URL (8 kyu) / JavaScript (0) | 2023.01.29 |
---|---|
[Codewars] Jenny's secret message (8 kyu) / JavaScript (0) | 2023.01.28 |
[Codewars] Will you make it? (8 kyu) / JavaScript (0) | 2023.01.26 |
[Codewars] Calculate BMI (8 kyu) / JavaScript (0) | 2023.01.25 |
[Codewars] Highest Scoring Word (6 kyu) / JavaScript (0) | 2023.01.24 |
댓글