473,383 Members | 1,792 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How to Seperate String to Perform Count?

1
New to Java (and programming in general) and trying to accept a sentence from the command line to count the consonants, vowels, and punctuation. What code do I need to perform the following?

1) Seperate each word so that it runs through the swtich to perform a count

2) Loop back to get each subsequent word until the sentence ends

I have it working when setting the sentence as a varible and reading it. Not sure how to take this next step.
Mar 9 '08 #1
2 1635
sukatoa
539 512MB
New to Java (and programming in general) and trying to accept a sentence from the command line to count the consonants, vowels, and punctuation. What code do I need to perform the following?

1) Seperate each word so that it runs through the swtich to perform a count

2) Loop back to get each subsequent word until the sentence ends

I have it working when setting the sentence as a varible and reading it. Not sure how to take this next step.
If i were to implement that, i will convert the args[0] to an array of characters...

start's from 0 to the max length of the char array, i will compare each character with the consonants, vowels and punctuations....

Update us,
Sukatoa
Mar 9 '08 #2
BigDaddyLH
1,216 Expert 1GB
Post your best attempt and ask a specific question about your code.
Mar 10 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Carlos Ribeiro | last post by:
Hi all, While writing a small program to help other poster at c.l.py, I found a small inconsistency between the handling of keyword parameters of string.split() and the split() method of...
15
by: Rick | last post by:
Hi, How can I convert a double such as 23.1 to a string? I don't want to use any library functions because the code is being written in avr-gcc and I don't like the way dtostrf() has been...
13
by: dimitris67 | last post by:
How can I replace an occurence of p(a string) in an other string(s) with np(new string).. char* replace _pattern(char *s,char *p,char *np) PLEASE HELP ME!!!!!
3
by: Hiroyuki Tanaka | last post by:
Dear Readers, I am trying to learn C# network programming and I have discovered that Windows TCPIP often joins small packets and send them as one to the remote server. This appears to be a...
10
by: Jon | last post by:
I want to count the number of instances of a certain string(delimiter) in another string. I didn't see a function to do this in the framework (if there is, please point me to it). If not, could...
12
by: Richard Lewis Haggard | last post by:
I thought that the whole point of StringBuilder was that it was supposed to be a faster way of building strings than string. However, I just put together a simple little application to do a...
2
by: willie | last post by:
John Machin: Thank you for your patience and for educating me. (Though I still have a long way to go before enlightenment) I thought Python might have a small weakness in lacking an...
3
by: Martin Pöpping | last post by:
Hello, I want to change a ProgressBar in a separate Thread. My current code is the following: private void changeProgressBarThread() { changeProgressBar(); }
2
by: yinglcs | last post by:
Can you please tell me why the following code does not work in python? My guess is I need to convert 'count' from a string to an integer. How can I do that? And my understanding is python is a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.