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. i am developing a video streaming PC server to j2m
View Tutorial          By: lama at 2010-04-17 01:27:27

2. useful for me
View Tutorial          By: ganga at 2010-10-06 00:51:51

3. hi Emiley J.,
i am geting this error while

View Tutorial          By: jugal at 2009-02-20 02:14:23

4. Excellent article
View Tutorial          By: JJ at 2011-03-21 13:42:35

5. Thanks a lot man !
PEace

View Tutorial          By: Karan Vohra at 2012-08-30 02:15:05

6. DOWNLOAD IT
View Tutorial          By: KUSUM at 2010-02-02 23:48:50

7. Hi it is working fine .but when my server we imple
View Tutorial          By: mohan at 2014-11-28 10:57:22

8. this is no doubt a simple program for the learner
View Tutorial          By: shweta at 2008-07-12 01:18:59

9. Hi Ashley, thank you for this Android Gridview tut
View Tutorial          By: Giancarlo Leonio at 2013-03-12 00:37:15

10. i want to study java
View Tutorial          By: doshyo at 2007-12-13 07:41:03