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



Ask a Question

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. Hey your help is really appreciated but I dont und
View Tutorial          By: farid khan at 2012-03-21 15:59:53

2. The above code given for sending SMS through your
View Tutorial          By: ROHAN at 2008-10-17 00:55:46

3. Very nice article.. thanks
View Tutorial          By: Basu at 2010-05-29 05:52:00

4. Many thanks for this tutorial. Exactly what I was
View Tutorial          By: Fedor Emelianenko at 2010-10-28 08:01:17

5. i want to know about java related topic in simple
View Tutorial          By: saurav at 2010-04-29 04:39:55

6. package practice_bo;

import practic

View Tutorial          By: nishi at 2011-12-09 02:00:20

7. Hi : Pulkit Malviya .I think that book has coding
View Tutorial          By: Anand at 2012-11-04 14:13:50

8. Hey guys it's working. If not then remove p.waitFo
View Tutorial          By: dileep at 2013-01-04 19:51:38

9. Showing code with quote tags is pretty rubbish. :/
View Tutorial          By: Daniel Jonsson at 2011-09-01 14:01:04

10. This is Nice start for programmer '
Thanks

View Tutorial          By: Sagar Ikhankar at 2011-07-22 06:12:44