Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Java code which finds the number of words of length N (say 3) in a given string

  1. #1
    Junior Member
    Join Date
    Sep 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Java code which finds the number of words of length N (say 3) in a given string

    Kindly provide me the java code which finds the number of words of length N (say 3) in a given string....Urgent !!


  2. #2
    Forum Squatter newbie's Avatar
    Join Date
    Nov 2010
    Location
    North Wales
    Posts
    661
    My Mood
    Stressed
    Thanks
    28
    Thanked 115 Times in 106 Posts
    Blog Entries
    1

    Default Re: Java code which finds the number of words of length N (say 3) in a given string

    public class SpoonfeedTest {
     
    	public static void main(String... args) {
    	    LengthFinder lengthFinder = new LengthFinder();
    	    String[] values = { "a", "b", "CC", "ddd", "b"};
    	    String[] output = lengthFinder.findStringsOfLength(2, values);
    	}
     
    }

    Glad to be of service.




    - This is not a homework service, show good will and post the code you've got currently, and ask questions surrounding issues you're having.
    Please use [highlight=Java]//code goes here...[/highlight] tags when posting your code

  3. #3
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 139 Times in 134 Posts

    Default Re: Java code which finds the number of words of length N (say 3) in a given string

    Quote Originally Posted by Shree View Post
    Kindly provide me the java code which finds the number of words of length N (say 3) in a given string....Urgent !!
    ... and I want a pony.... Urgent!!

Similar Threads

  1. Weird String .length() method
    By chronoz13 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: July 11th, 2012, 11:30 AM
  2. Maximum length of a string
    By ranjithfs1 in forum Java Theory & Questions
    Replies: 3
    Last Post: March 6th, 2012, 09:47 AM
  3. Can't figure out how to print out number of lines and words in a file in c++
    By javapenguin in forum Other Programming Languages
    Replies: 1
    Last Post: January 29th, 2012, 07:53 PM
  4. [SOLVED] Problem using the length of a string to bound the number of iterations of a for loop
    By dtitt3 in forum Loops & Control Statements
    Replies: 1
    Last Post: November 3rd, 2011, 02:44 PM
  5. Question: Converting number to words.
    By shamed in forum Java Theory & Questions
    Replies: 6
    Last Post: January 1st, 2010, 04:28 AM