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. thank you so much i learn from your tutorial i wis
View Tutorial          By: Anonymous at 2009-01-03 20:08:41

2. would you please send me a code that can be run pl
View Tutorial          By: putra at 2008-12-17 13:26:26

3. nice one !!! just keep it .. i have learn a lot..
View Tutorial          By: dondon at 2011-07-27 04:43:40

4. hi,i am new in java..plz send me java programmes i
View Tutorial          By: dinesh at 2012-12-30 15:58:31

5. It would he helpful to know difference between a l
View Tutorial          By: Tosh at 2012-04-28 18:00:20

6. Excellent!!!!!!!!!!

Tons of thanks

View Tutorial          By: Sara at 2009-06-03 05:38:59

7. can u tell me mobile tracker code in j2me
w

View Tutorial          By: aiyaz at 2010-08-21 16:29:08

8. My code runs smoothly. I have taken some steps for
View Tutorial          By: Amit Shrivastava at 2015-01-25 13:48:46

9. i use your program to read my GPS ( in COM11 ) .
View Tutorial          By: Dinesh rajapaksha at 2009-11-17 07:25:19

10. I want to creat a bilingual dictionary for mobile
View Tutorial          By: Maryam at 2011-01-25 02:28:44