Java source code examples

Java source code samples. Java code examples.

Finds out the position of last occurrence of String in a StringBuffer from the specified index

* * * * * 1 votes

Finds out the position of last occurrence of String in a StringBuffer from the specified index

public class StringBufferExample {
	public static void main(String[] args) {
		StringBuffer buff = new StringBuffer("Hello World");
		int value = buff.lastIndexOf("Hello" , 5);

		System.out.println(value);
	}
}

Tags: java.lang

Discuss This Code