Tuesday, 10 September 2013

Searching for a word in a string

Searching for a word in a string

I want to find the positions of a particular word in an input string using
java. I do not want to use regular expressions.For example if my input
string is " Rama Raman Rama" and if I want to find Rama then it should
give me Index number 0 and 11 as output. My code finds Rama in all the
three words which I do not want. Some help?

No comments:

Post a Comment