Select first letter in multiple words
    12 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Krish Desai
 il 5 Dic 2015
  
    
    
    
    
    Risposto: Walter Roberson
      
      
 il 5 Dic 2015
            I want to select the first letter in every word in a string statement.
example:
Input: 'Are you going to see the new ABC series season premiere tonight?'
Output: r y gng t s th nw BC srs ssn prmr tnght?
I'm using the following, how do I include the caps?
function output= remvow(x)
  vow='aeiou'
  for k = 1:5
    x(x == vow(k)) = [];
  end
  output=x
0 Commenti
Risposta accettata
  Walter Roberson
      
      
 il 5 Dic 2015
        vow = 'AEIOUaeiou';
x(ismember(x, vow)) = [];
But this does not have anything to do with removing the first letter of every word. It also does not deal with the case where 'y' is acting as a vowel, or the more subtle cases where 'l', 'm', 'n', 'r', or 'w' act as vowels in English.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Characters and Strings in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!