Results 1 to 3 of 3
Thread: How many words in a joptionpane
- 06-03-2012, 01:15 PM #1
Member
- Join Date
- Jun 2012
- Posts
- 1
- Rep Power
- 0
How many words in a joptionpane
Ok, i am 2 days away from an IT exam, i have a general idea of whats in it, i need to write a program, that counts how many words are there in a sentence via a joptionpane, how should i do this, i havent learnt tokens and stuff, but i know scanners and string handing, i wanted to somehow store the input so it can be scanned and i can count how many " " there are and space++ in a for loop, any advice?
- 06-03-2012, 02:58 PM #2
Senior Member
- Join Date
- Jun 2007
- Location
- Bali, Indonesia
- Posts
- 696
- Rep Power
- 6
Re: How many words in a joptionpane
Take a closer look at the java.util.Scanner class. You can define a delimiter pattern that will help you read the string as a tokens from the sentence. Here is a link to the Scanner javadoc for you to start: Scanner (Java Platform SE 7 )
Website: Learn Java by Examples
- 06-03-2012, 03:00 PM #3
Re: How many words in a joptionpane
Why do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
printing out words
By droidus in forum New To JavaReplies: 7Last Post: 09-16-2011, 03:17 AM -
Repeating words
By Junky in forum Suggestions & FeedbackReplies: 5Last Post: 08-18-2011, 05:42 AM -
Counting words
By Wasley in forum New To JavaReplies: 9Last Post: 01-30-2011, 10:57 PM -
Help: Num to words
By MyOnlineChurva in forum New To JavaReplies: 16Last Post: 01-08-2010, 01:41 AM -
help w words
By Gilgamesh in forum New To JavaReplies: 5Last Post: 11-21-2007, 06:15 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks