Results 1 to 4 of 4
  1. #1
    wethekings is offline Member
    Join Date
    Feb 2009
    Posts
    8
    Rep Power
    0

    Default Searching through a list.

    Hi, i made a list in gui using EasyApp.
    Java Code:
    List viewTestBox = addList("",170,50,600,180,this);
    now, lets just say this list was populated with words and stuff. Is there any way i could search through the list for a specific word, and get a return of the index of that word, like, the index of where the word was found. :D

  2. #2
    wethekings is offline Member
    Join Date
    Feb 2009
    Posts
    8
    Rep Power
    0

    Default

    ok, to make things simpler. i need to figure out how to search for a string, within a sentence, within an array.
    for example Array contains
    0 "The quick brown fox"
    1 "jumps over the"
    2 "lazy dog"
    Find: jump
    Word "jump" found in index: 1

    any help on this would be greatly appreciated.

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  4. #4
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    7

    Default String methods

    Could also use combinations of string methods contains() and/or indexOf() to do the job.

    Luck,
    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

Similar Threads

  1. Linked List integer list
    By igniteflow in forum Advanced Java
    Replies: 1
    Last Post: 12-10-2008, 08:53 PM
  2. How to access ArrayList in List of List?
    By alvations in forum New To Java
    Replies: 5
    Last Post: 10-08-2008, 12:23 PM
  3. Searching Arrays
    By BHCluster in forum New To Java
    Replies: 3
    Last Post: 07-26-2008, 05:55 AM
  4. searching within a JList
    By newtojava7 in forum New To Java
    Replies: 1
    Last Post: 03-10-2008, 12:12 AM
  5. searching
    By nalinda in forum New To Java
    Replies: 3
    Last Post: 12-06-2007, 02:56 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
  •