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. very brief and easy to understand description of R
View Tutorial          By: moona at 2010-05-26 22:49:26

2. thanks...........its really very helpful for me...
View Tutorial          By: ashwini agarmore at 2013-01-17 06:31:21

3. i din understand
View Tutorial          By: panda at 2011-07-14 09:35:36

4. nice explanation.but one thing in retrieving proce
View Tutorial          By: venkateswarlu at 2013-04-06 09:03:46

5. we are getting an error saying that " the sta
View Tutorial          By: chaitra at 2014-03-20 10:53:02

6. Thank so much it helped me God bless :)
View Tutorial          By: Judito at 2014-06-14 06:52:18

7. I want an example...to get multiple values using S
View Tutorial          By: Madhu at 2015-07-13 19:57:14

8. Hi to All,
I am working on struts based apl

View Tutorial          By: Ishmayel at 2009-02-19 21:27:14

9. There is better way to fix this problem..
<

View Tutorial          By: Sundara Kaku at 2011-07-23 10:38:52

10. is there any way to generate report without seagat
View Tutorial          By: Roshni at 2012-10-01 09:32:41