This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

finding a sequence in the string  RSS feed

 
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
Boost this thread!