Java Data Type Tutorial - Java StringBuilder.indexOf(String str, int fromIndex)








Syntax

StringBuilder.indexOf(String str, int fromIndex) has the following syntax.

public int indexOf(String str,  int fromIndex)

Example

In the following code shows how to use StringBuilder.indexOf(String str, int fromIndex) method.

public class Main {
/*from w  ww . j ava2s  .  c o  m*/
  public static void main(String[] arg) {

    StringBuilder buffer = new StringBuilder("from java2s.com");
    
    
    System.out.println(buffer.indexOf("ava",2));
  }

}

The code above generates the following result.