
-----------------------------------
shadowman571
Tue Oct 23, 2007 9:41 am

string.indexof question
-----------------------------------
im in class and my teacher is trying to teach us how to use . length

in "somestring.indexof(0,0) what does the second 0 do? my teacher is unsure of this can any one help? a quick answer would be realy helpful

-----------------------------------
rdrake
Tue Oct 23, 2007 9:52 am

Re: string.indexof question
-----------------------------------
A whisper in my ear tells me it would do this:

indexOf(String str, int fromIndex)
          Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.

So uh... probably the same thing asindexOf(0)in this case.

-----------------------------------
HeavenAgain
Tue Oct 23, 2007 10:40 am

RE:string.indexof question
-----------------------------------
i believe it does something like this
api is always useful, and you can always test out the code at the interaction.

-----------------------------------
Aziz
Sun Oct 28, 2007 12:46 pm

RE:string.indexof question
-----------------------------------
Whoa whoa whoa. Don't link him to old docs. 1.4 is much different than 1.6, though not in this case.

Here is the newest api docs:

http://java.sun.com/javase/6/docs/api/

I usually just google "java 6 whatever" where whatever is the class I'm looking for. For example:

google "java 6 String" and the first result is:

http://java.sun.com/javase/6/docs/api/java/lang/String.html

Your teacher doesn't sound like much of a programmer, at least with java. Is this highschool or college?

-----------------------------------
Nick
Sun Oct 28, 2007 12:55 pm

RE:string.indexof question
-----------------------------------
lol its Mr Holmes he was my turing teacher last year

anyway he's a programmer used to tell us stories of his old work and whatnot but i hear he is HORRIBLE at java

seen him carrying around like 10 "java for dummies" books

-----------------------------------
Aziz
Sun Oct 28, 2007 12:59 pm

RE:string.indexof question
-----------------------------------
Tell him about javadocs. Seriously. Java isn't java without 'em.

-----------------------------------
shadowman571
Sun Oct 28, 2007 7:25 pm

Re: string.indexof question
-----------------------------------
alright all thanks for the help

-----------------------------------
Nick
Tue Oct 30, 2007 12:15 pm

Re: RE:string.indexof question
-----------------------------------
lol its Mr Holmes he was my turing teacher last year

anyway he's a programmer used to tell us stories of his old work and whatnot but i hear he is HORRIBLE at java

seen him carrying around like 10 "java for dummies" books

sorry what i meeant to say was he is a great teacher just apprently not with java :S
