• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

finding a sequence in the string

 
abhijeet shrivastava
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String.indexOf() or the String.lastIndexOf() should do it for you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic