Javatpoint Logo

remove consonant

By: akhan0*** On: Thu Jul 20 15:00:08 IST 2017     Question Reputation0 Answer Reputation0 Quiz Belt Series Points0  0Blank User
write a program in java to remove consonant from given string. program should be simple.Up0Down

 


class A{
public static void main(String [] args){


String str= "imranmalik";

int len=str.length();


String nwstr ="";
for(int i=0;i<len;i++){
char ch=str.charAt(i);

if(ch!=a||ch!=e||ch!=i||ch!=o||ch!=u){
nwstr=nwstr+ch;
}

}
System.out.println(nwstr);

}

}
Image Created0Down

By: [email protected] On: Fri Jul 21 12:57:04 IST 2017 Question Reputation0 Answer Reputation0 Belt Series Points4 4User Image
Are You Satisfied :0Yes0No