Modo entrevista. Cronômetro de 5 min, sem dicas e sem autocompletar
Letters only
FácilStrings5 min
Write a function onlyLetters(text) that keeps only the Latin letters a to z and A to Z in a string. Digits, spaces, punctuation and letters of other alphabets are removed. Letters keep their case.
Exemplos
onlyLetters('a1b$c d!')Retorna 'abcd'
onlyLetters('Test123Case')Retorna 'TestCase'
onlyLetters('Привет, QA!')Retorna 'QA'
Cobrada em Paytm · Fonte
Carregando o editor...
- Entrada
onlyLetters('a1b$c d!')Esperado'abcd' - Entrada
onlyLetters('Test123Case')Esperado'TestCase' - Entrada
onlyLetters('Привет, QA!')Esperado'QA'
Os testes ocultos rodam no envio