Question d’entretien chez NiCE

Given a String s1= Apple, Write a program to convert s1 to array, and put vowels into array

Réponse à la question d'entretien

Utilisateur anonyme

16 oct. 2024

String s1= Apple char[] characters = s1.toCharArray(); char[]newvowels = ""; for (int i=0; i <=characters.length-1; i++) { if (characters[i]== 'a' || characters[i] == 'e' || characters[i] == 'i' || characters[i] == 'o' || characters[i] == 'u') newvowels = newvowels + characters[i]; }