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



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 want to get the SCJP ceretificate plz anybody ca
View Tutorial          By: arpita kotadia at 2012-09-01 06:50:03

2. You know what will be usefull if we can use this
View Tutorial          By: mechkid at 2012-12-03 14:54:41

3. Everything is running.... But it doesn't send....
View Tutorial          By: Amirtharaj at 2009-04-14 05:26:26

4. great work! such a super explanation.. thanks a lo
View Tutorial          By: vinu dominic at 2012-02-08 06:16:48

5. To DD -

The comment you just posted

View Tutorial          By: Alex at 2011-09-30 10:36:11

6. Hi, you put a semicolon after "int main()&quo
View Tutorial          By: noel4037 at 2009-12-28 06:40:17

7. respected Sir , I am doing B.Tech . I want to know
View Tutorial          By: naveen juneja at 2011-09-18 07:58:04

8. well example, but i have to send the received list
View Tutorial          By: amit kumar at 2011-02-21 00:43:15

9. can you non grab the data direct from the vector w
View Tutorial          By: paul at 2013-08-30 11:22:04

10. hi, srinivas ... i too was having the same problem
View Tutorial          By: Ashish at 2009-04-07 06:57:31