Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


jaiemar
Java2
1 Answer(s)      a year and 11 months ago
Posted in : Java Beginners


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)


Advertisement
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
the how applications The Java2 version was released in December 1998-1999
Java Programming Language
independence. The Java2 version was released in December 1998-1999. The new added... 1.2 8-Dec-1998 The Third release was Java2 Standard Edition (J2SE), Its
J2EE Tutorial - Introduction
, such as 'Java2 -complete reference' by Schildt.,with not a word anywhere... ..Distributed Objects') and Jaworsky ('Java2 Unleashed')  had
Open Source JVM
a complete solution for embedded devices. All Java2 language features are supported
Advertisements
 

 

 

DMCA.com