S
Subhabrata
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.
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.