Question: Write a static method that takes a string argument containing a person's full name as a parameter, and returns a string containing just their initials.

Write a static method that takes a string argument containing a person's full name as a parameter, and returns a string containing just their initials. The name may have many parts or just one, e.g., for the name "Cher" the method returns "C", for the name "Edna del Humboldt von der Schooch" the method returns "EdHvdS". Test your code.

Write a static method to find the index of the first vowel in a string (returning -1 if there are no vowels). Note an easy way to write the boolean condition "character ch is a vowel" is

"aeiouAEIOU".indexOf(ch) >= 0 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!