Comment on Tutorial - indexOf( ) and lastIndexOf( ) in Java By Hong



Comment Added by : Kyle

Comment Added at : 2012-03-22 09:17:04

Comment on Tutorial : indexOf( ) and lastIndexOf( ) in Java By Hong
ASNWERING: what's the purpose of indexOf('t',10) ?

The purpose is to look for the index of the character 't' STARTING at index 10;

For instance:
String str = "hello world";
//Let's say you wanted to find the index of the second 'o'.
//You say:
System.out.println(str.indexOf('o',5));
//This searches the string for 'o' starting immediately after
// first 'o'. (Remember, Strings are simply arrays, and their
// indexes start out at 0.


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. vry nice example....thanx..
View Tutorial          By: rekha at 2010-09-14 11:55:38

2. Dear !

Thanks for the article. Now

View Tutorial          By: Mubasher at 2013-05-04 11:37:52

3. nice effort
View Tutorial          By: Tiger at 2011-07-06 02:17:13

4. Thank you for Very good article.
View Tutorial          By: Pakornsak S at 2010-02-08 04:35:05

5. very nice for javascript beginers..
View Tutorial          By: Nilesh at 2012-08-29 10:19:13

6. hi, ashray p shetty
can you please tell me

View Tutorial          By: amrish at 2010-12-12 07:30:49

7. Thanks heaps, I had the file already there but it
View Tutorial          By: Jb at 2009-05-14 08:13:08

8. Its really good and helpfull..........
chee

View Tutorial          By: sumit at 2009-04-28 05:17:17

9. Very precise and informative tutorial. Appreciated
View Tutorial          By: Rishi Raj at 2011-07-08 12:25:04

10. im beginning to design a program that will deactiv
View Tutorial          By: andrew at 2012-01-29 14:32:39