aspose file tools*
The moose likes Beginning Java and the fly likes finding a sequence in the string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "finding a sequence in the string" Watch "finding a sequence in the string" New topic
Author

finding a sequence in the string

abhijeet shrivastava
Greenhorn

Joined: Jan 05, 2007
Posts: 10
Hi ranchers,

I want to check for a specified sequence in a string like

String first = "Hi all this is abhijeet";

now i want to search for "abhijeet" in that.so what method should i use.
Kaustabh Singha Roy
Ranch Hand

Joined: Oct 04, 2005
Posts: 43
String.indexOf() or the String.lastIndexOf() should do it for you.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: finding a sequence in the string