Use string methods to find and count vowels in a string?

前端 未结 9 2089
青春惊慌失措
青春惊慌失措 2020-12-02 02:04

I have this problem for homework (I\'m being honest, not trying to hide it at least) And I\'m having problems figuring out how to do it.

Given the following declarat

9条回答
  •  北海茫月
    2020-12-02 02:21

    To Count number of Vowels in a String:

    class Test {  
    
          static int a;
    
          public static String countVowel(String strName) { 
    
              char ch[] = strName.toCharArray();
    
    
              for(int i=0; i

提交回复
热议问题