944,082 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 4490
  • Java RSS
Nov 20th, 2004
0

stream tokenizer

Expand Post »
Can anyone give me a basic script that takes a string and converts it into a characters using the nexttoken command to get the next char for searching purposes.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jordanmc31 is offline Offline
3 posts
since Nov 2004
Nov 20th, 2004
0

Re: stream tokenizer

Try using a while loop and character array. Also look up StringTokenizer in the API: http://java.sun.com/j2se/1.4.2/docs/api/

You should be able to work it out from there.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
MrScruff is offline Offline
89 posts
since Nov 2004
Nov 20th, 2004
0

Re: stream tokenizer

I used the buffered reader to get the line. Then a string tokenizer to get it into seperate words. I have no idea on getting the words broken into chars
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jordanmc31 is offline Offline
3 posts
since Nov 2004
Nov 21st, 2004
0

Re: stream tokenizer

Ok look up String in the API - there are two methods which you can use in there.

and heres a tutorial on conversion:
http://mindprod.com/jgloss/conversion.html

Hope that helps
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
MrScruff is offline Offline
89 posts
since Nov 2004
Nov 21st, 2004
0

Re: stream tokenizer

Alright I got it into an array... Now I can't get through the array. I'm using a for loop to search character by character. At the end of the first character array i get an exception error and cant get past that part. Any other ideas for a way to get through the character array.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jordanmc31 is offline Offline
3 posts
since Nov 2004
Nov 21st, 2004
0

Re: stream tokenizer

Thats the best way to get through an array - is the exception error a arrayoutofbounds one? Check your i<whatever bit in the forloop - it may trying to check out more spaces in the array than there actually are.

Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
MrScruff is offline Offline
89 posts
since Nov 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Hyperlinks
Next Thread in Java Forum Timeline: How to make Java and C++ sockets play nice





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC