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



Ask a Question

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. enter no of line: 5 not fix value
out put i

View Tutorial          By: mark at 2013-01-31 14:30:00

2. please try to elaborate the explanation with examp
View Tutorial          By: bhavitha at 2014-02-21 06:09:12

3. a pretty good site for learners
View Tutorial          By: chaitra at 2011-12-15 10:09:14

4. in my case the culprit is xdebuger dll version 2.0
View Tutorial          By: putra at 2009-12-18 00:39:42

5. Simply explained theory.......
Thanx......!

View Tutorial          By: Priya at 2013-03-03 14:42:05

6. Its not working for me, also tried things written
View Tutorial          By: webian at 2010-01-24 10:33:23

7. can we do it this procedure by iteration i know th
View Tutorial          By: sattar at 2010-05-03 03:00:20

8. Well the code is good but what if students start e
View Tutorial          By: nitin kumar sharma at 2015-07-15 06:58:18

9. Just what I was looking for. Thank you.
View Tutorial          By: Babool at 2008-05-08 08:32:50

10. Awesome, now I can say I've fully understood volat
View Tutorial          By: Andrew at 2012-01-13 18:19:15