Results 1 to 3 of 3
  1. #1
    erik9920 is offline Member
    Join Date
    Sep 2011
    Posts
    3
    Rep Power
    0

    Default Need help filtering out words from a String with a certain ammount of characters.

    I have this String:
    String ordTabell[]={"a","b","aa","bb","cc","aaa","bbb","ccc","ddd"," aaaa","bbbb","cccc","dddd","eeee"};

    Basicly just some different words.
    I need to filtrate out the words that have x ammount of characters in it.
    IE: x=3 and i need to System.out.print the words that have 3 characters in them.

    What can i do in order to make this work? new to java.

    Thanks

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Need help filtering out words from a String with a certain ammount of characters.

    Point of correction: You don't have a String but rather an array of String, and this distinction is important.

    Now what exactly do you mean by "filtrate out the words"? Remove them from the array? put them in another array? only display the words on the screen that are OK? What?

    And what have you tried so far? It's always best to try before asking, and to show what you've tried.

  3. #3
    erik9920 is offline Member
    Join Date
    Sep 2011
    Posts
    3
    Rep Power
    0

    Default Re: Need help filtering out words from a String with a certain ammount of characters.

    Thanks, knowing that this is an array of String helped:) as i now know what to search for on google and the problem is fixed.

Similar Threads

  1. Reverse words of string.
    By Vikash Kumar Singh in forum Advanced Java
    Replies: 6
    Last Post: 08-07-2011, 01:28 PM
  2. count no of words in string
    By fakepics500 in forum New To Java
    Replies: 12
    Last Post: 07-19-2011, 11:49 AM
  3. Removing words from a String
    By nn12 in forum New To Java
    Replies: 3
    Last Post: 03-15-2011, 11:50 AM
  4. Creating unspecified ammount of objects
    By plm-pusik in forum New To Java
    Replies: 3
    Last Post: 09-01-2010, 07:46 PM
  5. Analyze a string of words
    By zoe in forum Advanced Java
    Replies: 2
    Last Post: 07-26-2007, 11:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •