Tuesday, 25 September 2012

Java Beginner : Strings and Arrays - Display words that start with a vowel in an user inserted string

 * To change this template, choose Tools | Templates
 * and open the template in the editor.
package javaapplication7;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

 * @author Sunshine
public class JavaApplication7 {


     * @param args the command line arguments
    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        System.out.println("Please enter some text");
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String names=br.readLine().toLowerCase();
        StringTokenizer stk=new StringTokenizer(names);
        String vowels="";
            String c=stk.nextToken();
                vowels=vowels+" "+c;

No comments:

Post a Comment