Modo entrevista. Temporizador de 5 min, sin pistas y sin autocompletado
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.
Ejemplos
onlyLetters('a1b$c d!')Devuelve 'abcd'
onlyLetters('Test123Case')Devuelve 'TestCase'
onlyLetters('Привет, QA!')Devuelve 'QA'
Preguntada en Paytm · Fuente
Cargando el editor…
- Entrada
onlyLetters('a1b$c d!')Esperado'abcd' - Entrada
onlyLetters('Test123Case')Esperado'TestCase' - Entrada
onlyLetters('Привет, QA!')Esperado'QA'
Las pruebas ocultas se ejecutan al enviar