Java2

Java2

Write a program that replaces a, e, i, o, u, with the letter z. (i.e. John Smith -> Jzhn Smzth. Also the program reverses the users name (i.e. John Smith -> htimS nhoJ)

View Answers

October 3, 2012 at 6:14 PM

Here is an example that replaces the vowels of string with the z and reverse the string.

class StringExamples 
    {
        public static void main(String[] args) 
        {
            String st="John Smith";
            String replaceString=st.replaceAll("[aeiou](?!\\b)", "z");
            System.out.println(replaceString);
            char ch[]=st.toCharArray();
            String revstring="";
            for(int i=ch.length-1;i>=0;i--){
                revstring+=Character.toString(ch[i]);
            }
            System.out.println(revstring);

        }
    }









Related Tutorials/Questions & Answers:
Java2
Java2  Write a program that replaces a, e, i, o, u, with the letter z. (i.e. John Smith -> Jzhn Smzth. Also the program reverses the users name (i.e. John Smith -> htimS nhoJ
About Java2
About Java2  sir i want to a develop one text editor but the problem is that i m not able to save our file as text formet or any formet Sir plz guide me
Advertisements
Write a program that replaces a, e, i, o, u in Java2
Write a program that replaces a, e, i, o, u in Java2  Write a program that replaces a, e, i, o, u, with the letter z. (i.e. John Smith -> Jzhn Smzth. Also the program reverses the users name (i.e. John Smith -> htimS nhoJ
java - Java Beginners
of the Collection framework. From java2 onwards it is fully compatible with collections... Hashtable is a concrete implementation of Dictionary from java2
Java Programming Language
will know about the how applications The Java2 version was released in December
Java Programming Language
independence. The Java2 version was released in December 1998-1999. The new added... 8-Dec-1998 The Third release was Java2 Standard Edition (J2SE), Its code name
J2EE Tutorial - Introduction
on Core Java , such as 'Java2 -complete reference' by Schildt... McCarty ('Java ..Distributed Objects') and Jaworsky ('Java2 Unleashed
Open Source JVM
) to provide a complete solution for embedded devices. All Java2 language features
JSP Tutorials Resource - Useful Jsp Tutorials Links and Resources
to use JSPs.      Java2 Servlets &

Ads