the string method lastIndexOf
807597Jan 11 2005 — edited Jan 11 2005Hi all,
I am new to Java Programming an d just started a week ago!I am just learning about strings right now and I hit a stone today with a little program:)
<HTML>
<HEAD>
<TITLE>Creating a String</TITLE>
</HEAD>
<BODY>
<H1>Creating a String</H1>
<%
String jsp = "JavaServer Pages is going to dominate the world!" ;
int index=jsp.lastIndexOf("dominate");
out.println(index);
%>
</BODY>
</HTML>
That is my programm,but the point is,that the method lastIndexOf don't get me the last index but the first!So when I run the programm I get the result 29 printed on my page,which is the same number generated ba the indexOf method!I don't have any idia why is that and i will really really appreciate your help!
Thanx verry much!
Best regards Daisy