aspose file tools*
The moose likes Beginning Java and the fly likes please help me with this code. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "please help me with this code." Watch "please help me with this code." New topic
Author

please help me with this code.

deepak bhai
Ranch Hand

Joined: Apr 22, 2011
Posts: 33



Find the number of occurrences of given word in a sentence.

why its not working
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 5018
    
    8

Please read this: ItDoesntWorkIsUseless (←click)


Junilu - [How to Ask Questions] [How to Answer Questions]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39861
    
  28
Write a sentence on paper, and use a pencil to go through the sentence and count not only how many times the word appears in the sentence, but also the index at which you are inspecting the sentence.
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Why are you checking the same condition in the while statement and the if inside the while?


SCJP, SCWCD.
|Asking Good Questions|
deepak kushwaha
Ranch Hand

Joined: Jul 17, 2010
Posts: 33
Thank you for all the help, The code is fixed. Thank you once again.
 
jQuery in Action, 2nd edition
 
subject: please help me with this code.