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.
onlyLetters('a1b$c d!')Returns 'abcd'
onlyLetters('Test123Case')Returns 'TestCase'
onlyLetters('Привет, QA!')Returns 'QA'
Asked at Paytm · Source
onlyLetters('a1b$c d!')'abcd'onlyLetters('Test123Case')'TestCase'onlyLetters('Привет, QA!')'QA'Hidden tests run on Submit.