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. what is the data type of the variable direction di
View Tutorial          By: maquilingdennymarc@yahoo.com at 2009-12-25 03:07:46

2. Hi, If any body was able to send the message suces
View Tutorial          By: kavin at 2011-03-14 06:24:18

3. thank for this script
because i will work

View Tutorial          By: r at 2009-06-27 05:07:31

4. Nicely explained concept. Thankx.
View Tutorial          By: Raghvendra at 2013-01-17 07:48:18

5. how to import myownclass into another class same p
View Tutorial          By: rana at 2013-04-19 17:32:08

6. it is very good for best practice of basics.......
View Tutorial          By: sushil ghimire at 2015-03-01 13:27:57

7. it is good
View Tutorial          By: kamal at 2009-11-01 19:58:54

8. Nice explanation with appropriate example
View Tutorial          By: VL at 2009-04-09 06:17:37

9. how can get ip url...?
View Tutorial          By: arjuna at 2011-11-23 03:31:46

10. I am certifed java Business Component Developer, m
View Tutorial          By: Kobs at 2013-02-26 11:58:22