X-Received: by 10.68.200.3 with SMTP id jo3mr181166pbc.5.1358956891364; Wed, 23 Jan 2013 08:01:31 -0800 (PST) X-Received: by 10.50.163.67 with SMTP id yg3mr5435859igb.12.1358956891285; Wed, 23 Jan 2013 08:01:31 -0800 (PST) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!f6no11571393pbd.1!news-out.google.com!s9ni12616pbb.0!nntp.google.com!f6no11571372pbd.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.help Date: Wed, 23 Jan 2013 08:01:30 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=122.161.165.164; posting-account=6SonuQoAAACzSakS5dCECcJQe6ylLrzY NNTP-Posting-Host: 122.161.165.164 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <43165a8a-3a3b-4869-aa7e-3c4e4bbc5898@googlegroups.com> Subject: For loop on Word List From: subhabangalore@gmail.com Injection-Date: Wed, 23 Jan 2013 16:01:31 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.java.help:2467 Dear Group, I am trying to learn Java. If I have a string like, "Moscow is the capital of Russia", I like to see it as, ["Moscow","is","the","capital","of","Russia"] "Moscow",0 "is",1 "the",2 "capital",3 "of",4 "Russia",5 the string into a bag of words, and each word and its corresponding index. If any one can help me. Regards, Subhabrata.