Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #21706
| Newsgroups | comp.lang.java.programmer |
|---|---|
| Date | 2013-01-25 09:07 -0800 |
| Message-ID | <8fb20d2d-260b-42a1-9899-d038d2abfa5e@gg5g2000pbc.googlegroups.com> (permalink) |
| Subject | Index of List |
| From | Subhabrata <subhabangalore@gmail.com> |
Dear Group, I am a new programmer in Java. I want to have check whether one word from one list is there in another list and if it is there I like to extract its next word. For example, If I have a string like, "Moscow is the capital of Russia" The wordlist would be "Moscow", "is","the","capital","of","Russia" Now suppose I have a string of words like, "Moscow", "Leningrad", "is", "was", "the", "a", "capital", "state", "of", "by", "Russia", "Romania" Here as one word is identified from the first string in the second string the cursor points to the next word, rather it exploits hashing. I know: (i) Declaring String. (ii)Using String.split (iii) I can use the for loop over the string and find out indexing. (iv) I know .equals But I think I am missing something like if Java has .find or .index sort of thing then it would be very easy to do. Does Java have anything? Regards, Subhabrata.
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread
Index of List Subhabrata <subhabangalore@gmail.com> - 2013-01-25 09:07 -0800 Re: Index of List Tim Slattery <Slattery_T@bls.gov> - 2013-01-25 12:38 -0500 Re: Index of List "John B. Matthews" <nospam@nospam.invalid> - 2013-01-25 12:48 -0500 Re: Index of List Arne Vajhøj <arne@vajhoej.dk> - 2013-01-25 21:44 -0500 Re: Index of List Roedy Green <see_website@mindprod.com.invalid> - 2013-01-26 19:22 -0800
csiph-web