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

Username:   Password: 
 RegisterRegister   
 Tokenizer Help
Index -> Programming, Java -> Java Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
wtd




PostPosted: Wed Dec 07, 2005 11:34 pm   Post subject: (No subject)

I agree. I see no signs that it's deprecated. Though, in all honesty, the Scanner class may duplicate much of its functionality in a somewhat more convenient form.
Sponsor
Sponsor
Sponsor
sponsor
jamonathin




PostPosted: Fri Dec 09, 2005 8:34 am   Post subject: (No subject)

One last question. How would i do this. The user inputs a series of "things", and then the user enters some options of what could be in those things, and I have to check wether or not those things are in there.

Such as . .
code:

First Input: (Pink,Green,Orange,Blue)
Second Input: (Pink,Yellow)

Answer: NO

First Input: (Pink,Green,Orange,Blue)
Second Input: (Blue,Green)

Answer: YES


Confused pleh
wtd




PostPosted: Fri Dec 09, 2005 9:48 am   Post subject: (No subject)

http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collection.html

Check out the containsAll method
jamonathin




PostPosted: Fri Dec 09, 2005 10:45 am   Post subject: (No subject)

Ok, easy enough, now how to I break up the second line. As in, how do i seperate the words.

I know i have to go
Java:

String[] hold = two.split("(");

and split it part by part, then i would go something like
Pseudo:

for (int i = 1 ; i <= upper(hold) ; i++)
{
     str += hold[i];
}
String[] hold = hold.split(",");

then repeat for ( ")" ); . . but how can i look for the upper bounds of [i]hold?
, or maybe there's an easier way Confused . .
jamonathin




PostPosted: Fri Dec 09, 2005 10:47 am   Post subject: (No subject)

(where's edit Confused) Oh, and the second entry isn't in any specific order either, but I know that the final if statement will look something like

Java:

if (one.contains(two) == true)
wtd




PostPosted: Fri Dec 09, 2005 11:09 am   Post subject: (No subject)

The input format is guaranteed?

Is fo, then just "trim" off extra whitespace, remove the two parens, trim whitespace again, then split on: "\s*,\s*".
jamonathin




PostPosted: Fri Dec 09, 2005 12:05 pm   Post subject: (No subject)

Ok sounds good, thanx wtd Smile.
wtd




PostPosted: Fri Dec 09, 2005 2:47 pm   Post subject: (No subject)

wtd wrote:
Is fo


Yay! I'm channeling Dan again.
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 2 of 2  [ 23 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: