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. Thanks, you save my day!
View Tutorial          By: ivex at 2015-06-25 20:20:07

2. Fantastic yaar .realy very good n simple example..
View Tutorial          By: Satya at 2012-10-11 09:33:17

3. Hi

Can you anyone please post me th

View Tutorial          By: Damodhar at 2009-05-06 04:12:33

4. awesome...its very understandable one..thnq..:)
View Tutorial          By: sharan at 2010-02-08 10:58:17

5. "THIS IS SAMPLE EXMPLE!!!!!!!!!!11111"
View Tutorial          By: david billa at 2012-08-02 06:23:43

6. Fantastic tutorial...
very help full to me

View Tutorial          By: venkat b at 2013-05-30 17:16:04

7. this is the best example of method overriding but
View Tutorial          By: Dipesh at 2009-09-09 12:52:21

8. awesome. thanks for the info
View Tutorial          By: Darren at 2010-05-09 19:55:22

9. package alphabets;

import java.util

View Tutorial          By: Nitish at 2013-01-25 04:06:38

10. doesn't work with 3 , 7 and 5 but with numbers hig
View Tutorial          By: asd at 2013-05-11 09:25:30