java programmming: string manipulation

java programmming: string manipulation

WAP to accept a string from the user, using buffered reader and then find the frequency of character 'e' occurring in it

View Answers

August 31, 2012 at 11:56 AM

Here is a java example that reads a string from the command prompt and find the frequency of the character e in the input string.

import java.io.*;

class FindFrequencyOFCharacter 
{
    public static void main(String[] args) 
    {
        try{
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        System.out.print("Enter String: ");
        String st=br.readLine();
        int count=0;
        char ch[]=st.toCharArray();
        for(int i=0;i<ch.length;i++){
            if(ch[i]=='e'){
                count++;
            }
        }
        System.out.println("Frequency of character e is: "+count);
        }
        catch(Exception e){}
    }
}

Ads









Related Tutorials/Questions & Answers:
Java String manipulation
Java String manipulation  You are given two strings S1 and S2,Delete from S2 all those characters which occur in s1 also and create a clean S2 with the relevant characters deleted..write a pgm for this..pls send as soon
java programmming: string manipulation
java programmming: string manipulation  WAP to accept a string from...' occurring in it   Here is a java example that reads a string from the command prompt and find the frequency of the character e in the input string
Advertisements
string manipulation
string manipulation  Write a program in java and accept 10 strings form the user. store them in an array. then find the string with the maaximum length and print
string manipulation
string manipulation  write a java program that asks the user to enter a string(where a consonant means insert, a punctuation means return element at the top and a vowel means remove the maximum) to be applied to an initially
string manipulation
string manipulation  write a java program that asks the user to enter a string(where a consonant means insert, a punctuation means return element at the top and a vowel means remove the maximum) to be applied to an initially
string manipulation in xml
string manipulation in xml  im working on build.xml using apache ant... in one of the targets i am assigning a var file with the full path of .sql... on this. P.S. the project is not a java project
Manipulation of war fie contents
Manipulation of war fie contents  How can I manipulate a specific file inside my war file without extracting it? Please help... Thanks and regards, Swapnil
ModuleNotFoundError: No module named 'data-manipulation'
ModuleNotFoundError: No module named 'data-manipulation'  Hi, My... named 'data-manipulation' How to remove the ModuleNotFoundError: No module named 'data-manipulation' error? Thanks   Hi, In your
Image Manipulation in Swing AWT
Image Manipulation in Swing AWT  Sir, I'am new to Swing Programming. I have to create an application where an image is displayed on one Label. The same image has to be split in parts and stored in database pert wise. Later
ModuleNotFoundError: No module named 'cloudsat-object-manipulation'
ModuleNotFoundError: No module named 'cloudsat-object-manipulation'  ...: No module named 'cloudsat-object-manipulation' How to remove the ModuleNotFoundError: No module named 'cloudsat-object-manipulation' error
ModuleNotFoundError: No module named 'cloudsat-object-manipulation'
ModuleNotFoundError: No module named 'cloudsat-object-manipulation'  ...: No module named 'cloudsat-object-manipulation' How to remove the ModuleNotFoundError: No module named 'cloudsat-object-manipulation' error
ModuleNotFoundError: No module named 'cloudsat-object-manipulation'
ModuleNotFoundError: No module named 'cloudsat-object-manipulation'  ...: No module named 'cloudsat-object-manipulation' How to remove the ModuleNotFoundError: No module named 'cloudsat-object-manipulation' error
ModuleNotFoundError: No module named 'django-dynamic-manipulation'
ModuleNotFoundError: No module named 'django-dynamic-manipulation'  ...: No module named 'django-dynamic-manipulation' How to remove the ModuleNotFoundError: No module named 'django-dynamic-manipulation' error? Thanks
Working with CSS(CSS Manipulation)
Working with CSS(CSS Manipulation)       Working with CSS(CSS Manipulation) These methods are used to manipulate CSS specially by getting and setting
Mysql Date Manipulation
Mysql Date Manipulation       Mysql Date Manipulation find out the difference between two values... Date Manipulation. To grasp this example, we create a table 'Person' with field
could not execute native bulk manipulation query
could not execute native bulk manipulation query  I am insert data... Action { private static final String SUCCESS = "success"; private static final String FAILURE = "failure"; boolean flag; @Override
Trouble with array manipulation
(String args[]){ Random r = new Random(); int array [] = new int...); } public static void main (String[] args){ let max = array[0... java.util.Random; public class ArrayRandom{ public static void main(String args
Java BigInteger example
Java BigInteger example     ... (such as add, subtract) , prime generation , bit manipulation and many other useful...; public static void main(String[] args)    
Java example program to get extension
Java example program to get extension       java get extension To get the file name and file extension separately we can do the string manipulation on the file name. Suppose
Apache POI API for Microsoft Doc's Manipulation
Apache POI API for Microsoft Doc's Manipulation This section contains... manipulation means reading, writing, formating etc. This library also supports the manipulation of new extension of Microsoft Office which is .docx, .xlsx
Online Mysql Training
an important role in date manipulation language. The Online training on Mysql provides.... Simple Functions (String, Date, Numerical) Understanding the Primary
Extending Java with Yield
code manipulation on plain java classes enables us an interesting mechanism... Extending Java with Yield          Yielder library is a library that uses Java 1.5
Java Operators List
are nothing else but just symbols in Java which are used to perform manipulation...Java Operators List  What are the Java operators, please explain and share the Java operator list.   Java Operators List Any Java beginner
Java Operators List
are nothing else but just symbols in Java which are used to perform manipulation...Java Operators List  What are the Java operators, please explain and share the Java operator list.   Java Operators List Any Java beginner
Java Operators List
are nothing else but just symbols in Java which are used to perform manipulation...Java Operators List  What are the Java operators, please explain and share the Java operator list.   Java Operators List Any Java beginner
Java Operators List
are nothing else but just symbols in Java which are used to perform manipulation...Java Operators List  What are the Java operators, please explain and share the Java operator list.   Java Operators List Any Java beginner
Java Operators List
are nothing else but just symbols in Java which are used to perform manipulation...Java Operators List  What are the Java operators, please explain and share the Java operator list.   Java Operators List Any Java beginner
Struts 2 version 2.3.16.3 released
framework, which can be used to develop enterprise grade applications in Java technologies which can run on Java enabled servers. The Struts 2 framework
Struts 2 Action Tag
for data manipulation or creation. When executeResult parameter is specified
Getting Started With Java
or java provides many utility interfaces and classes for easy manipulation... Getting Started With Java       JDK 6 Tutorial The latest news for the java programmers
Java Hibernate
Java Hibernate      ... library for the java language by mapping an object-oriented domain model...: Hibernate maps the java classes to database tables. Hibernate provides its own data

Ads