How cam I write a method that takes in a String and returns a new string that replaces every vowel with two occurrences of that vowel.
Show older comments
public String doubleVowel(String str) {
}
Answers (2)
Stephen23
on 2 Dec 2015
>> str = 'hello world!';
>> regexprep(str,'([aeiou])','$1$1')
ans = heelloo woorld!
Walter Roberson
on 2 Dec 2015
0 votes
First you have to show us your String class. MATLAB does not have a String class.
It looks to me that you are asking homework questions about a different programming language.
Categories
Find more on String Parsing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!