Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 string.indexof question
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
shadowman571




PostPosted: Tue Oct 23, 2007 9:41 am   Post subject: 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
Sponsor
Sponsor
Sponsor
sponsor
rdrake




PostPosted: Tue Oct 23, 2007 9:52 am   Post subject: Re: string.indexof question

A whisper in my ear tells me it would do this:

Quote:
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 as
Java:
indexOf(0)
in this case.
HeavenAgain




PostPosted: Tue Oct 23, 2007 10:40 am   Post subject: 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




PostPosted: Sun Oct 28, 2007 12:46 pm   Post subject: 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




PostPosted: Sun Oct 28, 2007 12:55 pm   Post subject: 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




PostPosted: Sun Oct 28, 2007 12:59 pm   Post subject: RE:string.indexof question

Tell him about javadocs. Seriously. Java isn't java without 'em.
shadowman571




PostPosted: Sun Oct 28, 2007 7:25 pm   Post subject: Re: string.indexof question

alright all thanks for the help
Nick




PostPosted: Tue Oct 30, 2007 12:15 pm   Post subject: Re: RE:string.indexof question

momop @ Sun Oct 28, 2007 12:55 pm wrote:
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
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: