java string find first occurrence regex code example
Example: java find first occurrence in string
// Use indexOf()
String myStr = "Hello planet earth, you are a great planet.";
System.out.println(myStr.indexOf("planet"));
// Use indexOf()
String myStr = "Hello planet earth, you are a great planet.";
System.out.println(myStr.indexOf("planet"));