const string = "ThE Quick Brown E U"
class find {
constructor() {
this.consonants = "bcdfghjklmnpqrstvwxz"
this.vowels = "aeiuo"
this.result = ""
}
findString(str) {
this.result = {
"Lvowels": this.Lvowels(str),
"Cvowels": this.Cvowels(str),
"Lconsonant": this.Lconsonant(str),
"Cconsonant": this.Cconsonant(str)
}
return this.result
}
Lvowels(str) {
const newStr = str.split("")
const text = this.vowels.split("")
let v = ""
for (let i = 0; i < text.length; i++) {
if (newStr.includes(text[i])) {
v += text[i]
}
}
return v
}
Lconsonant(str) {
const newStr = str.split("")
const text = this.consonants.split("")
let v = ""
for (let i = 0; i < text.length; i++) {
if (newStr.includes(text[i])) {
v += text[i]
}
}
return v
}
Cvowels(str) {
const newArr = str.split("")
const text = this.vowels.toUpperCase().split("")
let v = ""
for (let i = 0; i < text.length; i++) {
if (newArr.includes(text[i])) {
v += text[i]
}
}
return v
}
Cconsonant(str) {
const newArr = str.split("")
const text = this.consonants.toUpperCase().split("")
let v = ""
for (let i = 0; i < text.length; i++) {
if (newArr.includes(text[i])) {
v += text[i]
}
}
return v
}
}
const f = new find()
let Lvowels = f.findString(string)["Lvowels"]
let Cvowels = f.findString(string)["Cvowels"]
let Lconsonant = f.findString(string)["Lconsonant"]
let Cconsonant = f.findString(string)["Cconsonant"]
console.log(Lvowels)
console.log(Cvowels)
console.log(Lconsonant)
console.log(Cconsonant)